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)
97 #ifdef _USE_32BIT_TIME_T
98 #define _localtime32 localtime
99 #define _difftime32 difftime
100 #define _ctime32 ctime
101 #define _gmtime32 gmtime
102 #define _mktime32 mktime
122 #define CLOCKS_PER_SEC 1000
124 __MINGW_IMPORT
int _daylight
;
125 __MINGW_IMPORT
long _dstbias
;
126 __MINGW_IMPORT
long _timezone
;
127 __MINGW_IMPORT
char * _tzname
[2];
129 _CRTIMP errno_t __cdecl
_get_daylight(int *_Daylight
);
130 _CRTIMP errno_t __cdecl
_get_dstbias(long *_Daylight_savings_bias
);
131 _CRTIMP errno_t __cdecl
_get_timezone(long *_Timezone
);
132 _CRTIMP errno_t __cdecl
_get_tzname(size_t *_ReturnValue
,char *_Buffer
,size_t _SizeInBytes
,int _Index
);
133 char *__cdecl
asctime(const struct tm
*_Tm
);
134 _CRTIMP
char *__cdecl
_ctime32(const __time32_t
*_Time
);
135 clock_t __cdecl
clock(void);
136 _CRTIMP
double __cdecl
_difftime32(__time32_t _Time1
,__time32_t _Time2
);
137 _CRTIMP
struct tm
*__cdecl
_gmtime32(const __time32_t
*_Time
);
138 _CRTIMP
struct tm
*__cdecl
_localtime32(const __time32_t
*_Time
);
139 size_t __cdecl
strftime(char *_Buf
,size_t _SizeInBytes
,const char *_Format
,const struct tm
*_Tm
);
140 _CRTIMP
size_t __cdecl
_strftime_l(char *_Buf
,size_t _Max_size
,const char *_Format
,const struct tm
*_Tm
,_locale_t _Locale
);
141 _CRTIMP
char *__cdecl
_strdate(char *_Buffer
);
142 _CRTIMP
char *__cdecl
_strtime(char *_Buffer
);
143 _CRTIMP __time32_t __cdecl
_time32(__time32_t
*_Time
);
144 _CRTIMP __time32_t __cdecl
_mktime32(struct tm
*_Tm
);
145 _CRTIMP __time32_t __cdecl
_mkgmtime32(struct tm
*_Tm
);
146 #if defined (_POSIX_) || defined(__GNUC__)
147 void __cdecl
tzset(void);
149 _CRTIMP
void __cdecl
_tzset(void);
151 #if _INTEGRAL_MAX_BITS >= 64
152 double __cdecl
_difftime64(__time64_t _Time1
,__time64_t _Time2
);
153 _CRTIMP
char *__cdecl
_ctime64(const __time64_t
*_Time
);
154 _CRTIMP
struct tm
*__cdecl
_gmtime64(const __time64_t
*_Time
);
155 _CRTIMP
struct tm
*__cdecl
_localtime64(const __time64_t
*_Time
);
156 _CRTIMP __time64_t __cdecl
_mktime64(struct tm
*_Tm
);
157 _CRTIMP __time64_t __cdecl
_mkgmtime64(struct tm
*_Tm
);
158 _CRTIMP __time64_t __cdecl
_time64(__time64_t
*_Time
);
160 unsigned __cdecl
_getsystime(struct tm
*_Tm
);
161 unsigned __cdecl
_setsystime(struct tm
*_Tm
,unsigned _MilliSec
);
163 #ifndef _WTIME_DEFINED
164 _CRTIMP
wchar_t *__cdecl
_wasctime(const struct tm
*_Tm
);
165 _CRTIMP
wchar_t *__cdecl
_wctime32(const __time32_t
*_Time
);
166 size_t __cdecl
wcsftime(wchar_t *_Buf
,size_t _SizeInWords
,const wchar_t *_Format
,const struct tm
*_Tm
);
167 _CRTIMP
size_t __cdecl
_wcsftime_l(wchar_t *_Buf
,size_t _SizeInWords
,const wchar_t *_Format
,const struct tm
*_Tm
,_locale_t _Locale
);
168 _CRTIMP
wchar_t *__cdecl
_wstrdate(wchar_t *_Buffer
);
169 _CRTIMP
wchar_t *__cdecl
_wstrtime(wchar_t *_Buffer
);
170 #if _INTEGRAL_MAX_BITS >= 64
171 _CRTIMP
wchar_t *__cdecl
_wctime64(const __time64_t
*_Time
);
174 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
175 #define _INC_WTIME_INL
176 #ifdef _USE_32BIT_TIME_T
177 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime32(_Time
); }
179 __CRT_INLINE
wchar_t *__cdecl
_wctime(const time_t *_Time
) { return _wctime64(_Time
); }
183 #define _WTIME_DEFINED
187 double __cdecl
difftime(time_t _Time1
,time_t _Time2
);
188 char *__cdecl
ctime(const time_t *_Time
);
189 struct tm
*__cdecl
gmtime(const time_t *_Time
);
190 struct tm
*__cdecl
localtime(const time_t *_Time
);
191 struct tm
*__cdecl
localtime_r(const time_t *_Time
,struct tm
*);
193 _CRTIMP
time_t __cdecl
mktime(struct tm
*_Tm
);
194 _CRTIMP
time_t __cdecl
_mkgmtime(struct tm
*_Tm
);
195 _CRTIMP
time_t __cdecl
time(time_t *_Time
);
197 #ifdef _USE_32BIT_TIME_T
199 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime32(_Time1
,_Time2
); }
200 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime32(_Time
); }
201 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime32(_Time
); }
202 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime32(_Time
); }
203 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime32(_Tm
); }
204 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime32(_Tm
); }
205 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time32(_Time
); }
208 __CRT_INLINE
double __cdecl
difftime(time_t _Time1
,time_t _Time2
) { return _difftime64(_Time1
,_Time2
); }
209 __CRT_INLINE
char *__cdecl
ctime(const time_t *_Time
) { return _ctime64(_Time
); }
210 __CRT_INLINE
struct tm
*__cdecl
gmtime(const time_t *_Time
) { return _gmtime64(_Time
); }
211 __CRT_INLINE
struct tm
*__cdecl
localtime(const time_t *_Time
) { return _localtime64(_Time
); }
212 __CRT_INLINE
time_t __cdecl
mktime(struct tm
*_Tm
) { return _mktime64(_Tm
); }
213 __CRT_INLINE
time_t __cdecl
_mkgmtime(struct tm
*_Tm
) { return _mkgmtime64(_Tm
); }
214 __CRT_INLINE
time_t __cdecl
time(time_t *_Time
) { return _time64(_Time
); }
218 #if !defined(NO_OLDNAMES) || defined(_POSIX)
219 #define CLK_TCK CLOCKS_PER_SEC
221 _CRTIMP
extern int daylight
;
222 _CRTIMP
extern long timezone
;
223 _CRTIMP
extern char *tzname
[2];
224 void __cdecl
tzset(void);
227 #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
228 #define _TIMEVAL_DEFINED
233 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
234 #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)
235 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
236 #endif /* _TIMEVAL_DEFINED */
244 #include <sec_api/time_s.h>
246 /* Adding timespec definition. */
247 #include <sys/timeb.h>
249 #endif /* End _TIME_H_ */