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.
13 #error Only Win32 target is supported!
16 #pragma pack(push,_CRT_PACKING)
22 #ifndef _TIME32_T_DEFINED
23 #define _TIME32_T_DEFINED
24 typedef long __time32_t
;
27 #ifndef _TIME64_T_DEFINED
28 #define _TIME64_T_DEFINED
29 #if _INTEGRAL_MAX_BITS >= 64
30 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
31 typedef int _time64_t
__attribute__ ((mode (DI
)));
33 __MINGW_EXTENSION
typedef __int64 __time64_t
;
38 #ifndef _TIME_T_DEFINED
39 #define _TIME_T_DEFINED
40 #ifdef _USE_32BIT_TIME_T
41 typedef __time32_t
time_t;
43 typedef __time64_t
time_t;
47 #ifndef _CLOCK_T_DEFINED
48 #define _CLOCK_T_DEFINED
52 #ifndef _SIZE_T_DEFINED
53 #define _SIZE_T_DEFINED
56 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
57 typedef unsigned int size_t __attribute__ ((mode (DI
)));
59 __MINGW_EXTENSION
typedef unsigned __int64
size_t;
62 typedef unsigned int size_t;
70 #define NULL ((void *)0)
89 #define CLOCKS_PER_SEC 1000
91 _CRTDATA(extern int _daylight
);
92 _CRTDATA(extern long _dstbias
);
93 _CRTDATA(extern long _timezone
);
94 _CRTDATA(extern char * _tzname
[2]);
96 _CRTIMP errno_t __cdecl
_get_daylight(_Out_
int *_Daylight
);
97 _CRTIMP errno_t __cdecl
_get_dstbias(_Out_
long *_Daylight_savings_bias
);
98 _CRTIMP errno_t __cdecl
_get_timezone(_Out_
long *_Timezone
);
104 _Out_
size_t *_ReturnValue
,
105 _Out_writes_z_(_SizeInBytes
) char *_Buffer
,
106 _In_
size_t _SizeInBytes
,
111 _CRT_INSECURE_DEPRECATE(asctime_s
)
115 _In_
const struct tm
*_Tm
);
118 _CRT_INSECURE_DEPRECATE(_ctime32_s
)
122 _In_
const __time32_t
*_Time
);
124 _Check_return_ _CRTIMP
clock_t __cdecl
clock(void);
130 _In_ __time32_t _Time1
,
131 _In_ __time32_t _Time2
);
135 _CRT_INSECURE_DEPRECATE(_gmtime32_s
)
139 _In_
const __time32_t
*_Time
);
142 _CRT_INSECURE_DEPRECATE(_localtime32_s
)
146 _In_
const __time32_t
*_Time
);
148 _Success_(return > 0)
153 _Out_writes_z_(_SizeInBytes
) char *_Buf
,
154 _In_
size_t _SizeInBytes
,
155 _In_z_ _Printf_format_string_
const char *_Format
,
156 _In_
const struct tm
*_Tm
);
158 _Success_(return > 0)
163 _Out_writes_z_(_Max_size
) char *_Buf
,
164 _In_
size_t _Max_size
,
165 _In_z_ _Printf_format_string_
const char *_Format
,
166 _In_
const struct tm
*_Tm
,
167 _In_opt_ _locale_t _Locale
);
169 _CRTIMP
char *__cdecl
_strdate(_Out_writes_z_(9) char *_Buffer
);
170 _CRTIMP
char *__cdecl
_strtime(_Out_writes_z_(9) char *_Buffer
);
171 _CRTIMP __time32_t __cdecl
_time32(_Out_opt_ __time32_t
*_Time
);
172 _CRTIMP __time32_t __cdecl
_mktime32(_Inout_
struct tm
*_Tm
);
173 _CRTIMP __time32_t __cdecl
_mkgmtime32(_Inout_
struct tm
*_Tm
);
174 _CRTIMP
void __cdecl
_tzset(void);
175 _CRT_OBSOLETE(GetLocalTime
) unsigned __cdecl
_getsystime(_Out_
struct tm
*_Tm
);
177 _CRT_OBSOLETE(GetLocalTime
)
189 _Out_writes_(_SizeInBytes
) _Post_readable_size_(26) char *_Buf
,
190 _In_range_(>= , 26) size_t _SizeInBytes
,
191 _In_
const struct tm
*_Tm
);
193 _Success_(return == 0)
198 _Out_writes_(_SizeInBytes
) _Post_readable_size_(26) char *_Buf
,
199 _In_
size_t _SizeInBytes
,
200 _In_
const __time32_t
*_Time
);
208 _In_
const __time32_t
*_Time
);
214 _Out_
struct tm
*_Tm
,
215 _In_
const __time32_t
*_Time
);
222 _Out_writes_(_SizeInBytes
) _Post_readable_size_(9) char *_Buf
,
223 _In_range_(>= , 9) size_t _SizeInBytes
);
230 _Out_writes_(_SizeInBytes
) _Post_readable_size_(9) char *_Buf
,
231 _In_range_(>= , 9) size_t _SizeInBytes
);
233 #if _INTEGRAL_MAX_BITS >= 64
240 _In_ __time64_t _Time1
,
241 _In_ __time64_t _Time2
);
244 _CRT_INSECURE_DEPRECATE(_ctime64_s
)
248 _In_
const __time64_t
*_Time
);
251 _CRT_INSECURE_DEPRECATE(_gmtime64_s
)
255 _In_
const __time64_t
*_Time
);
258 _CRT_INSECURE_DEPRECATE(_localtime64_s
)
262 _In_
const __time64_t
*_Time
);
264 _CRTIMP __time64_t __cdecl
_mktime64(_Inout_
struct tm
*_Tm
);
265 _CRTIMP __time64_t __cdecl
_mkgmtime64(_Inout_
struct tm
*_Tm
);
266 _CRTIMP __time64_t __cdecl
_time64(_Out_opt_ __time64_t
*_Time
);
272 _Out_writes_z_(_SizeInBytes
) char *_Buf
,
273 _In_
size_t _SizeInBytes
,
274 _In_
const __time64_t
*_Time
);
280 _Out_
struct tm
*_Tm
,
281 _In_
const __time64_t
*_Time
);
287 _Out_
struct tm
*_Tm
,
288 _In_
const __time64_t
*_Time
);
290 #endif /* _INTEGRAL_MAX_BITS >= 64 */
292 #ifndef _WTIME_DEFINED
293 #define _WTIME_DEFINED
296 _CRT_INSECURE_DEPRECATE(_wasctime_s
)
300 _In_
const struct tm
*_Tm
);
302 _CRTIMP
wchar_t *__cdecl
_wctime(const time_t *_Time
);
305 _CRT_INSECURE_DEPRECATE(_wctime32_s
)
309 _In_
const __time32_t
*_Time
);
311 _Success_(return > 0)
316 _Out_writes_z_(_SizeInWords
) wchar_t *_Buf
,
317 _In_
size_t _SizeInWords
,
318 _In_z_ _Printf_format_string_
const wchar_t *_Format
,
319 _In_
const struct tm
*_Tm
);
321 _Success_(return > 0)
326 _Out_writes_z_(_SizeInWords
) wchar_t *_Buf
,
327 _In_
size_t _SizeInWords
,
328 _In_z_ _Printf_format_string_
const wchar_t *_Format
,
329 _In_
const struct tm
*_Tm
,
330 _In_opt_ _locale_t _Locale
);
332 _CRTIMP
wchar_t *__cdecl
_wstrdate(_Out_writes_z_(9) wchar_t *_Buffer
);
333 _CRTIMP
wchar_t *__cdecl
_wstrtime(_Out_writes_z_(9) wchar_t *_Buffer
);
339 _Out_writes_(_SizeInWords
) _Post_readable_size_(26) wchar_t *_Buf
,
340 _In_range_(>= , 26) size_t _SizeInWords
,
341 _In_
const struct tm
*_Tm
);
343 _Success_(return == 0)
348 _Out_writes_(_SizeInWords
) _Post_readable_size_(26) wchar_t *_Buf
,
349 _In_
size_t _SizeInWords
,
350 _In_
const __time32_t
*_Time
);
356 _Out_writes_(_SizeInWords
) _Post_readable_size_(9) wchar_t *_Buf
,
357 _In_
size_t _SizeInWords
);
363 _Out_writes_(_SizeInWords
) _Post_readable_size_(9) wchar_t *_Buf
,
364 _In_range_(>= , 9) size_t _SizeInWords
);
366 #if _INTEGRAL_MAX_BITS >= 64
369 _CRT_INSECURE_DEPRECATE(_wctime64_s
)
373 _In_
const __time64_t
*_Time
);
375 _Success_(return == 0)
380 _Out_writes_(_SizeInWords
) _Post_readable_size_(26) wchar_t *_Buf
,
381 _In_
size_t _SizeInWords
,
382 _In_
const __time64_t
*_Time
);
384 #endif /* _INTEGRAL_MAX_BITS >= 64 */
386 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
387 #define _INC_WTIME_INL
388 #ifdef _USE_32BIT_TIME_T
389 /* Do it like this to be compatible to msvcrt.dll on 32 bit windows XP and before */
390 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime32(_Time
); }
391 __CRT_INLINE errno_t __cdecl
_wctime_s(wchar_t *_Buffer
, size_t _SizeInWords
,const __time32_t
*_Time
) { return _wctime32_s(_Buffer
, _SizeInWords
, _Time
); }
393 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime64(_Time
); }
394 __CRT_INLINE errno_t __cdecl
_wctime_s(wchar_t *_Buffer
, size_t _SizeInWords
,const time_t *_Time
) { return _wctime64_s(_Buffer
, _SizeInWords
, _Time
); }
398 #endif /* !_WTIME_DEFINED */
400 _CRTIMP
double __cdecl
difftime(time_t _Time1
,time_t _Time2
);
401 _CRTIMP
char *__cdecl
ctime(const time_t *_Time
);
402 _CRTIMP
struct tm
*__cdecl
gmtime(const time_t *_Time
);
403 _CRTIMP
struct tm
*__cdecl
localtime(const time_t *_Time
);
404 _CRTIMP
struct tm
*__cdecl
localtime_r(const time_t *_Time
,struct tm
*);
406 _CRTIMP
time_t __cdecl
mktime(struct tm
*_Tm
);
407 _CRTIMP
time_t __cdecl
_mkgmtime(struct tm
*_Tm
);
408 _CRTIMP
time_t __cdecl
time(time_t *_Time
);
410 #if !defined(RC_INVOKED) && !defined(_NO_INLINING) && !defined(_CRTBLD)
411 #ifdef _USE_32BIT_TIME_T
413 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime32(_Time1
,_Time2
); }
414 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime32(_Time
); }
415 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime32(_Time
); }
416 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime32(_Time
); }
417 __CRT_INLINE errno_t __cdecl
localtime_s(struct tm
*_Tm
,const time_t *_Time
) { return _localtime32_s(_Tm
,_Time
); }
418 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime32(_Tm
); }
419 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime32(_Tm
); }
420 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time32(_Time
); }
423 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime64(_Time1
,_Time2
); }
424 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime64(_Time
); }
425 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime64(_Time
); }
426 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime64(_Time
); }
427 __CRT_INLINE errno_t __cdecl
localtime_s(struct tm
*_Tm
,const time_t *_Time
) { return _localtime64_s(_Tm
,_Time
); }
428 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime64(_Tm
); }
429 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime64(_Tm
); }
430 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time64(_Time
); }
434 #if !defined(NO_OLDNAMES) || defined(_POSIX)
435 #define CLK_TCK CLOCKS_PER_SEC
437 _CRTIMP
extern int daylight
;
438 _CRTIMP
extern long timezone
;
439 _CRTIMP
extern char *tzname
[2];
440 _CRTIMP
void __cdecl
tzset(void);
449 #endif /* End _TIME_H_ */