2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
12 #error Only Win32 target is supported!
15 #pragma pack(push,_CRT_PACKING)
21 #ifndef _TIME32_T_DEFINED
22 #define _TIME32_T_DEFINED
23 typedef long __time32_t
;
26 #ifndef _TIME64_T_DEFINED
27 #define _TIME64_T_DEFINED
28 #if _INTEGRAL_MAX_BITS >= 64
29 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
30 typedef int _time64_t
__attribute__ ((mode (DI
)));
32 __MINGW_EXTENSION
typedef __int64 __time64_t
;
37 #ifndef _TIME_T_DEFINED
38 #define _TIME_T_DEFINED
39 #ifdef _USE_32BIT_TIME_T
40 typedef __time32_t
time_t;
42 typedef __time64_t
time_t;
46 #ifndef _CLOCK_T_DEFINED
47 #define _CLOCK_T_DEFINED
51 #ifndef _SIZE_T_DEFINED
52 #define _SIZE_T_DEFINED
55 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
56 typedef unsigned int size_t __attribute__ ((mode (DI
)));
58 __MINGW_EXTENSION
typedef unsigned __int64
size_t;
61 typedef unsigned int size_t;
69 #define NULL ((void *)0)
88 #define CLOCKS_PER_SEC 1000
90 _CRTDATA(extern int _daylight
);
91 _CRTDATA(extern long _dstbias
);
92 _CRTDATA(extern long _timezone
);
93 _CRTDATA(extern char * _tzname
[2]);
95 _CRTIMP errno_t __cdecl
_get_daylight(int *_Daylight
);
96 _CRTIMP errno_t __cdecl
_get_dstbias(long *_Daylight_savings_bias
);
97 _CRTIMP errno_t __cdecl
_get_timezone(long *_Timezone
);
98 _CRTIMP errno_t __cdecl
_get_tzname(size_t *_ReturnValue
,char *_Buffer
,size_t _SizeInBytes
,int _Index
);
100 _CRTIMP
_CRT_INSECURE_DEPRECATE(asctime_s
) char *__cdecl
asctime(const struct tm
*_Tm
);
101 _CRTIMP
_CRT_INSECURE_DEPRECATE(_ctime32_s
) char *__cdecl
_ctime32(const __time32_t
*_Time
);
102 _CRTIMP
clock_t __cdecl
clock(void);
103 _CRTIMP
double __cdecl
_difftime32(__time32_t _Time1
,__time32_t _Time2
);
104 _CRTIMP
_CRT_INSECURE_DEPRECATE(_gmtime32_s
) struct tm
*__cdecl
_gmtime32(const __time32_t
*_Time
);
105 _CRTIMP
_CRT_INSECURE_DEPRECATE(_localtime32_s
) struct tm
*__cdecl
_localtime32(const __time32_t
*_Time
);
106 _CRTIMP
size_t __cdecl
strftime(char *_Buf
,size_t _SizeInBytes
,const char *_Format
,const struct tm
*_Tm
);
107 _CRTIMP
size_t __cdecl
_strftime_l(char *_Buf
,size_t _Max_size
,const char *_Format
,const struct tm
*_Tm
,_locale_t _Locale
);
108 _CRTIMP
char *__cdecl
_strdate(char *_Buffer
);
109 _CRTIMP
char *__cdecl
_strtime(char *_Buffer
);
110 _CRTIMP __time32_t __cdecl
_time32(__time32_t
*_Time
);
111 _CRTIMP __time32_t __cdecl
_mktime32(struct tm
*_Tm
);
112 _CRTIMP __time32_t __cdecl
_mkgmtime32(struct tm
*_Tm
);
113 _CRTIMP
void __cdecl
_tzset(void);
114 _CRT_OBSOLETE(GetLocalTime
) unsigned __cdecl
_getsystime(struct tm
*_Tm
);
115 _CRT_OBSOLETE(GetLocalTime
) unsigned __cdecl
_setsystime(struct tm
*_Tm
,unsigned _MilliSec
);
117 _CRTIMP errno_t __cdecl
_ctime32_s(char *_Buf
,size_t _SizeInBytes
,const __time32_t
*_Time
);
118 _CRTIMP errno_t __cdecl
_gmtime32_s(struct tm
*_Tm
,const __time32_t
*_Time
);
119 _CRTIMP errno_t __cdecl
_localtime32_s(struct tm
*_Tm
,const __time32_t
*_Time
);
120 _CRTIMP errno_t __cdecl
_strdate_s(char *_Buf
,size_t _SizeInBytes
);
121 _CRTIMP errno_t __cdecl
_strtime_s(char *_Buf
,size_t _SizeInBytes
);
123 #if _INTEGRAL_MAX_BITS >= 64
124 _CRTIMP
double __cdecl
_difftime64(__time64_t _Time1
,__time64_t _Time2
);
125 _CRTIMP
_CRT_INSECURE_DEPRECATE(_ctime64_s
) char *__cdecl
_ctime64(const __time64_t
*_Time
);
126 _CRTIMP
_CRT_INSECURE_DEPRECATE(_gmtime64_s
) struct tm
*__cdecl
_gmtime64(const __time64_t
*_Time
);
127 _CRTIMP
_CRT_INSECURE_DEPRECATE(_localtime64_s
) struct tm
*__cdecl
_localtime64(const __time64_t
*_Time
);
128 _CRTIMP __time64_t __cdecl
_mktime64(struct tm
*_Tm
);
129 _CRTIMP __time64_t __cdecl
_mkgmtime64(struct tm
*_Tm
);
130 _CRTIMP __time64_t __cdecl
_time64(__time64_t
*_Time
);
132 _CRTIMP errno_t __cdecl
_ctime64_s(char *_Buf
,size_t _SizeInBytes
,const __time64_t
*_Time
);
133 _CRTIMP errno_t __cdecl
_gmtime64_s(struct tm
*_Tm
,const __time64_t
*_Time
);
134 _CRTIMP errno_t __cdecl
_localtime64_s(struct tm
*_Tm
,const __time64_t
*_Time
);
137 #ifndef _WTIME_DEFINED
138 #define _WTIME_DEFINED
139 _CRTIMP
_CRT_INSECURE_DEPRECATE(_wasctime_s
) wchar_t *__cdecl
_wasctime(const struct tm
*_Tm
);
140 _CRTIMP
wchar_t *__cdecl
_wctime(const time_t *_Time
);
141 _CRTIMP
_CRT_INSECURE_DEPRECATE(_wctime32_s
) wchar_t *__cdecl
_wctime32(const __time32_t
*_Time
);
142 _CRTIMP
size_t __cdecl
wcsftime(wchar_t *_Buf
,size_t _SizeInWords
,const wchar_t *_Format
,const struct tm
*_Tm
);
143 _CRTIMP
size_t __cdecl
_wcsftime_l(wchar_t *_Buf
,size_t _SizeInWords
,const wchar_t *_Format
,const struct tm
*_Tm
,_locale_t _Locale
);
144 _CRTIMP
wchar_t *__cdecl
_wstrdate(wchar_t *_Buffer
);
145 _CRTIMP
wchar_t *__cdecl
_wstrtime(wchar_t *_Buffer
);
147 _CRTIMP errno_t __cdecl
_wasctime_s(wchar_t *_Buf
,size_t _SizeInWords
,const struct tm
*_Tm
);
148 _CRTIMP errno_t __cdecl
_wctime32_s(wchar_t *_Buf
,size_t _SizeInWords
,const __time32_t
*_Time
);
149 _CRTIMP errno_t __cdecl
_wstrdate_s(wchar_t *_Buf
,size_t _SizeInWords
);
150 _CRTIMP errno_t __cdecl
_wstrtime_s(wchar_t *_Buf
,size_t _SizeInWords
);
151 #if _INTEGRAL_MAX_BITS >= 64
152 _CRTIMP
_CRT_INSECURE_DEPRECATE(_wctime64_s
) wchar_t *__cdecl
_wctime64(const __time64_t
*_Time
);
153 _CRTIMP errno_t __cdecl
_wctime64_s(wchar_t *_Buf
,size_t _SizeInWords
,const __time64_t
*_Time
);
156 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
157 #define _INC_WTIME_INL
158 #ifdef _USE_32BIT_TIME_T
159 /* Do it like this to be compatible to msvcrt.dll on 32 bit windows XP and before */
160 __CRT_INLINE
wchar_t *__cdecl
_wctime32(const time_t *_Time
) { return _wctime(_Time
); }
161 __CRT_INLINE errno_t
_wctime32_s(wchar_t *_Buffer
, size_t _SizeInWords
,const __time32_t
*_Time
) { return _wctime32_s(_Buffer
, _SizeInWords
, _Time
); }
163 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime64(_Time
); }
164 __CRT_INLINE errno_t
_wctime_s(wchar_t *_Buffer
, size_t _SizeInWords
,const time_t *_Time
) { return _wctime64_s(_Buffer
, _SizeInWords
, _Time
); }
168 #endif /* !_WTIME_DEFINED */
170 _CRTIMP
double __cdecl
difftime(time_t _Time1
,time_t _Time2
);
171 _CRTIMP
char *__cdecl
ctime(const time_t *_Time
);
172 _CRTIMP
struct tm
*__cdecl
gmtime(const time_t *_Time
);
173 _CRTIMP
struct tm
*__cdecl
localtime(const time_t *_Time
);
174 _CRTIMP
struct tm
*__cdecl
localtime_r(const time_t *_Time
,struct tm
*);
176 _CRTIMP
time_t __cdecl
mktime(struct tm
*_Tm
);
177 _CRTIMP
time_t __cdecl
_mkgmtime(struct tm
*_Tm
);
178 _CRTIMP
time_t __cdecl
time(time_t *_Time
);
181 #ifdef _USE_32BIT_TIME_T
183 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime32(_Time1
,_Time2
); }
184 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime32(_Time
); }
185 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime32(_Time
); }
186 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime32(_Time
); }
187 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime32(_Tm
); }
188 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime32(_Tm
); }
189 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time32(_Time
); }
192 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime64(_Time1
,_Time2
); }
193 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime64(_Time
); }
194 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime64(_Time
); }
195 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime64(_Time
); }
196 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime64(_Tm
); }
197 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime64(_Tm
); }
198 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time64(_Time
); }
202 #if !defined(NO_OLDNAMES) || defined(_POSIX)
203 #define CLK_TCK CLOCKS_PER_SEC
205 _CRTIMP
extern int daylight
;
206 _CRTIMP
extern long timezone
;
207 _CRTIMP
extern char *tzname
[2];
208 _CRTIMP
void __cdecl
tzset(void);
217 #include <sec_api/time_s.h>
219 #endif /* End _TIME_H_ */