Commit | Line | Data |
a272e669 |
1 | #include <time.h> |
2 | |
3 | #ifndef LOCALTIME64_H |
4 | # define LOCALTIME64_H |
5 | |
9af24521 |
6 | /* Configuration. */ |
7 | /* Define as appropriate for your system */ |
8 | /* |
9 | HAS_TIMEGM |
10 | Defined if your system has timegm() |
a272e669 |
11 | |
9af24521 |
12 | HAS_TM_TM_GMTOFF |
13 | Defined if your tm struct has a "tm_gmtoff" element. |
14 | |
15 | HAS_TM_TM_ZONE |
16 | Defined if your tm struct has a "tm_zone" element. |
a64acb40 |
17 | |
18 | SYSTEM_LOCALTIME_MAX |
19 | SYSTEM_LOCALTIME_MIN |
20 | SYSTEM_GMTIME_MAX |
21 | SYSTEM_GMTIME_MIN |
22 | Maximum and minimum values your system's gmtime() and localtime() |
23 | can handle. |
24 | |
25 | USE_SYSTEM_LOCALTIME |
26 | USE_SYSTEM_GMTIME |
27 | Should we use the system functions if the time is inside their range? |
9af24521 |
28 | */ |
a64acb40 |
29 | #define SYSTEM_LOCALTIME_MAX 2147483647 /* XXX Replace with LOCALTIME_MAX */ |
30 | #define SYSTEM_LOCALTIME_MIN -2147483648 /* XXX Replace with LOCALTIME_MIN */ |
31 | #define SYSTEM_GMTIME_MAX GMTIME_MAX |
32 | #define SYSTEM_GMTIME_MIN GMTIME_MIN |
33 | |
34 | /* It'll be faster */ |
35 | #define USE_SYSTEM_LOCALTIME 1 |
36 | |
37 | /* No point risking system bugs, ours works fine */ |
38 | #define USE_SYSTEM_GMTIME 0 |
9af24521 |
39 | |
40 | |
41 | /* 64 bit types. Set as appropriate for your system. */ |
42 | typedef Quad_t Time64_T; |
43 | typedef Quad_t Int64; |
44 | |
45 | struct tm *gmtime64_r (const Time64_T *, struct tm *); |
46 | struct tm *localtime64_r (const Time64_T *, struct tm *); |
a272e669 |
47 | |
48 | #endif |