4 * Copyright 2000 Francois Gouget.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include <corecrt_wtime.h>
27 #ifndef _CLOCK_T_DEFINED
28 typedef __msvcrt_long
clock_t;
29 #define _CLOCK_T_DEFINED
32 #ifndef CLOCKS_PER_SEC
33 #define CLOCKS_PER_SEC 1000
41 #define _daylight (*__p__daylight())
42 #define _dstbias (*__p__dstbias())
43 #define _timezone (*__p__timezone())
44 #define _tzname (__p__tzname())
46 _ACRTIMP
int * __cdecl
__p__daylight(void);
47 _ACRTIMP __msvcrt_long
* __cdecl
__p__dstbias(void);
48 _ACRTIMP __msvcrt_long
* __cdecl
__p__timezone(void);
49 _ACRTIMP
char ** __cdecl
__p__tzname(void);
52 extern __msvcrt_long _dstbias
;
53 extern __msvcrt_long _timezone
;
57 #if !defined(_UCRT) && defined(_USE_32BIT_TIME_T)
58 #define _ctime32 ctime
59 #define _difftime32 difftime
60 #define _gmtime32 gmtime
61 #define _localtime32 localtime
62 #define _mktime32 mktime
66 _ACRTIMP
unsigned __cdecl
_getsystime(struct tm
*);
67 _ACRTIMP
unsigned __cdecl
_setsystime(struct tm
*,unsigned);
68 _ACRTIMP
char* __cdecl
_strdate(char*);
69 _ACRTIMP errno_t __cdecl
_strdate_s(char*,size_t);
70 _ACRTIMP
char* __cdecl
_strtime(char*);
71 _ACRTIMP errno_t __cdecl
_strtime_s(char*,size_t);
72 _ACRTIMP
void __cdecl
_tzset(void);
74 _ACRTIMP
char* __cdecl
asctime(const struct tm
*);
75 _ACRTIMP
clock_t __cdecl
clock(void);
76 _ACRTIMP
char* __cdecl
_ctime32(const __time32_t
*);
77 _ACRTIMP errno_t __cdecl
_ctime32_s(char*,size_t,const __time32_t
*);
78 _ACRTIMP
char* __cdecl
_ctime64(const __time64_t
*);
79 _ACRTIMP errno_t __cdecl
_ctime64_s(char*,size_t,const __time64_t
*);
80 _ACRTIMP
double __cdecl
_difftime32(__time32_t
,__time32_t
);
81 _ACRTIMP
double __cdecl
_difftime64(__time64_t
,__time64_t
);
82 _ACRTIMP
struct tm
* __cdecl
_gmtime32(const __time32_t
*);
83 _ACRTIMP
struct tm
* __cdecl
_gmtime64(const __time64_t
*);
84 _ACRTIMP
struct tm
* __cdecl
_localtime32(const __time32_t
*);
85 _ACRTIMP errno_t __cdecl
_localtime32_s(struct tm
*, const __time32_t
*);
86 _ACRTIMP
struct tm
* __cdecl
_localtime64(const __time64_t
*);
87 _ACRTIMP errno_t __cdecl
_localtime64_s(struct tm
*, const __time64_t
*);
88 _ACRTIMP __time32_t __cdecl
_mktime32(struct tm
*);
89 _ACRTIMP __time64_t __cdecl
_mktime64(struct tm
*);
90 _ACRTIMP
size_t __cdecl
strftime(char*,size_t,const char*,const struct tm
*);
91 _ACRTIMP __time32_t __cdecl
_time32(__time32_t
*);
92 _ACRTIMP __time64_t __cdecl
_time64(__time64_t
*);
94 #ifndef _USE_32BIT_TIME_T
95 static inline char* ctime(const time_t *t
) { return _ctime64(t
); }
96 static inline errno_t
ctime_s(char *res
, size_t len
, const __time64_t
*t
) { return _ctime64_s(res
, len
, t
); }
97 static inline double difftime(time_t t1
, time_t t2
) { return _difftime64(t1
, t2
); }
98 static inline struct tm
* gmtime(const time_t *t
) { return _gmtime64(t
); }
99 static inline struct tm
* localtime(const time_t *t
) { return _localtime64(t
); }
100 static inline errno_t
localtime_s(struct tm
*res
, const time_t *t
) { return _localtime64_s(res
, t
); }
101 static inline time_t mktime(struct tm
*tm
) { return _mktime64(tm
); }
102 static inline time_t time(time_t *t
) { return _time64(t
); }
104 static inline char* ctime(const time_t *t
) { return _ctime32(t
); }
105 static inline errno_t
ctime_s(char *res
, size_t len
, const __time32_t
*t
) { return _ctime32_s(res
, len
, t
); }
106 static inline double difftime(time_t t1
, time_t t2
) { return _difftime32(t1
, t2
); }
107 static inline struct tm
* gmtime(const time_t *t
) { return _gmtime32(t
); }
108 static inline struct tm
* localtime(const time_t *t
) { return _localtime32(t
); }
109 static inline errno_t
localtime_s(struct tm
*res
, const time_t *t
) { return _localtime32_s(res
, t
); }
110 static inline time_t mktime(struct tm
*tm
) { return _mktime32(tm
); }
111 static inline time_t time(time_t *t
) { return _time32(t
); }
120 #endif /* __WINE_TIME_H */