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)
22 #define _CRTIMP __declspec(dllimport)
25 #ifndef _WCHAR_T_DEFINED
26 #define _WCHAR_T_DEFINED
27 typedef unsigned short wchar_t;
30 #ifndef _TIME32_T_DEFINED
31 #define _TIME32_T_DEFINED
32 typedef long __time32_t
;
35 #ifndef _TIME64_T_DEFINED
36 #define _TIME64_T_DEFINED
37 #if _INTEGRAL_MAX_BITS >= 64
38 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
39 typedef int _time64_t
__attribute__ ((mode (DI
)));
41 typedef __int64 __time64_t
;
46 #ifndef _TIME_T_DEFINED
47 #define _TIME_T_DEFINED
48 #ifdef _USE_32BIT_TIME_T
49 typedef __time32_t
time_t;
51 typedef __time64_t
time_t;
55 #ifndef _CLOCK_T_DEFINED
56 #define _CLOCK_T_DEFINED
60 #ifndef _SIZE_T_DEFINED
61 #define _SIZE_T_DEFINED
64 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
65 typedef unsigned int size_t __attribute__ ((mode (DI
)));
67 typedef unsigned __int64
size_t;
70 typedef unsigned int size_t;
74 #ifndef _SSIZE_T_DEFINED
75 #define _SSIZE_T_DEFINED
78 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
79 typedef int ssize_t
__attribute__ ((mode (DI
)));
81 typedef __int64 ssize_t
;
92 #define NULL ((void *)0)
96 #ifdef _USE_32BIT_TIME_T
97 #define _localtime32 localtime
98 #define _difftime32 difftime
99 #define _ctime32 ctime
100 #define _gmtime32 gmtime
101 #define _mktime32 mktime
120 #define CLOCKS_PER_SEC 1000
122 __MINGW_IMPORT
int _daylight
;
123 __MINGW_IMPORT
long _dstbias
;
124 __MINGW_IMPORT
long _timezone
;
125 __MINGW_IMPORT
char * _tzname
[2];
126 _CRTIMP errno_t __cdecl
_get_daylight(int *_Daylight
);
127 _CRTIMP errno_t __cdecl
_get_dstbias(long *_Daylight_savings_bias
);
128 _CRTIMP errno_t __cdecl
_get_timezone(long *_Timezone
);
129 _CRTIMP errno_t __cdecl
_get_tzname(size_t *_ReturnValue
,char *_Buffer
,size_t _SizeInBytes
,int _Index
);
130 char *__cdecl
asctime(const struct tm
*_Tm
);
131 _CRTIMP
char *__cdecl
_ctime32(const __time32_t
*_Time
);
132 clock_t __cdecl
clock(void);
133 _CRTIMP
double __cdecl
_difftime32(__time32_t _Time1
,__time32_t _Time2
);
134 _CRTIMP
struct tm
*__cdecl
_gmtime32(const __time32_t
*_Time
);
135 _CRTIMP
struct tm
*__cdecl
_localtime32(const __time32_t
*_Time
);
136 size_t __cdecl
strftime(char *_Buf
,size_t _SizeInBytes
,const char *_Format
,const struct tm
*_Tm
);
137 _CRTIMP
size_t __cdecl
_strftime_l(char *_Buf
,size_t _Max_size
,const char *_Format
,const struct tm
*_Tm
,_locale_t _Locale
);
138 _CRTIMP
char *__cdecl
_strdate(char *_Buffer
);
139 _CRTIMP
char *__cdecl
_strtime(char *_Buffer
);
140 _CRTIMP __time32_t __cdecl
_time32(__time32_t
*_Time
);
141 _CRTIMP __time32_t __cdecl
_mktime32(struct tm
*_Tm
);
142 _CRTIMP __time32_t __cdecl
_mkgmtime32(struct tm
*_Tm
);
143 #if defined (_POSIX_) || defined(__GNUC__)
144 void __cdecl
tzset(void);
146 _CRTIMP
void __cdecl
_tzset(void);
149 #if _INTEGRAL_MAX_BITS >= 64
150 double __cdecl
_difftime64(__time64_t _Time1
,__time64_t _Time2
);
151 _CRTIMP
char *__cdecl
_ctime64(const __time64_t
*_Time
);
152 _CRTIMP
struct tm
*__cdecl
_gmtime64(const __time64_t
*_Time
);
153 _CRTIMP
struct tm
*__cdecl
_localtime64(const __time64_t
*_Time
);
154 _CRTIMP __time64_t __cdecl
_mktime64(struct tm
*_Tm
);
155 _CRTIMP __time64_t __cdecl
_mkgmtime64(struct tm
*_Tm
);
156 _CRTIMP __time64_t __cdecl
_time64(__time64_t
*_Time
);
158 unsigned __cdecl
_getsystime(struct tm
*_Tm
);
159 unsigned __cdecl
_setsystime(struct tm
*_Tm
,unsigned _MilliSec
);
161 #ifndef _SIZE_T_DEFINED
162 #define _SIZE_T_DEFINED
164 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
165 typedef unsigned int size_t __attribute__ ((mode (DI
)));
167 typedef unsigned __int64
size_t;
170 typedef unsigned long size_t;
174 #ifndef _SSIZE_T_DEFINED
175 #define _SSIZE_T_DEFINED
177 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
178 typedef int ssize_t
__attribute__ ((mode (DI
)));
180 typedef __int64 ssize_t
;
183 typedef long ssize_t
;
187 #ifndef _WTIME_DEFINED
188 _CRTIMP
wchar_t *__cdecl
_wasctime(const struct tm
*_Tm
);
189 _CRTIMP
wchar_t *__cdecl
_wctime32(const __time32_t
*_Time
);
190 size_t __cdecl
wcsftime(wchar_t *_Buf
,size_t _SizeInWords
,const wchar_t *_Format
,const struct tm
*_Tm
);
191 _CRTIMP
size_t __cdecl
_wcsftime_l(wchar_t *_Buf
,size_t _SizeInWords
,const wchar_t *_Format
,const struct tm
*_Tm
,_locale_t _Locale
);
192 _CRTIMP
wchar_t *__cdecl
_wstrdate(wchar_t *_Buffer
);
193 _CRTIMP
wchar_t *__cdecl
_wstrtime(wchar_t *_Buffer
);
194 #if _INTEGRAL_MAX_BITS >= 64
195 _CRTIMP
wchar_t *__cdecl
_wctime64(const __time64_t
*_Time
);
198 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
199 #define _INC_WTIME_INL
200 #ifdef _USE_32BIT_TIME_T
201 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime32(_Time
); }
203 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime64(_Time
); }
207 #define _WTIME_DEFINED
211 double __cdecl
difftime(time_t _Time1
,time_t _Time2
);
212 char *__cdecl
ctime(const time_t *_Time
);
213 struct tm
*__cdecl
gmtime(const time_t *_Time
);
214 struct tm
*__cdecl
localtime(const time_t *_Time
);
215 struct tm
*__cdecl
localtime_r(const time_t *_Time
,struct tm
*);
217 time_t __cdecl
mktime(struct tm
*_Tm
);
218 time_t __cdecl
_mkgmtime(struct tm
*_Tm
);
219 time_t __cdecl
time(time_t *_Time
);
221 #ifdef _USE_32BIT_TIME_T
223 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime32(_Time1
,_Time2
); }
224 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime32(_Time
); }
225 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime32(_Time
); }
226 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime32(_Time
); }
227 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime32(_Tm
); }
228 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime32(_Tm
); }
229 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time32(_Time
); }
232 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime64(_Time1
,_Time2
); }
233 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime64(_Time
); }
234 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime64(_Time
); }
235 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime64(_Time
); }
236 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime64(_Tm
); }
237 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime64(_Tm
); }
238 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time64(_Time
); }
242 #if !defined(NO_OLDNAMES) || defined(_POSIX)
243 #define CLK_TCK CLOCKS_PER_SEC
245 __MINGW_IMPORT
int daylight
;
246 __MINGW_IMPORT
long dstbias
;
247 __MINGW_IMPORT
long timezone
;
248 __MINGW_IMPORT
char *tzname
[2];
249 void __cdecl
tzset(void);
252 #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
253 #define _TIMEVAL_DEFINED
258 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
259 #define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec==(uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
260 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
261 #endif /* _TIMEVAL_DEFINED */
263 #ifndef __STRICT_ANSI__
264 #ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
265 #define _TIMEZONE_DEFINED
271 extern int __cdecl
mingw_gettimeofday (struct timeval
*p
, struct timezone
*z
);
273 #endif /* __STRICT_ANSI__ */
281 #include <sec_api/time_s.h>
283 /* Adding timespec definition. */
284 #include <sys/timeb.h>
286 #endif /* End _TIME_H_ */