This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
We are no longer slaves to the vagaries of time_t.
[perl5.git] / localtime64.h
CommitLineData
a272e669
MS
1#ifndef LOCALTIME64_H
2# define LOCALTIME64_H
3
9af24521
MS
4/* Configuration. */
5/* Define as appropriate for your system */
6/*
7 HAS_TIMEGM
8 Defined if your system has timegm()
a272e669 9
9af24521
MS
10 HAS_TM_TM_GMTOFF
11 Defined if your tm struct has a "tm_gmtoff" element.
12
13 HAS_TM_TM_ZONE
14 Defined if your tm struct has a "tm_zone" element.
a64acb40
MS
15
16 SYSTEM_LOCALTIME_MAX
17 SYSTEM_LOCALTIME_MIN
18 SYSTEM_GMTIME_MAX
19 SYSTEM_GMTIME_MIN
20 Maximum and minimum values your system's gmtime() and localtime()
21 can handle.
22
23 USE_SYSTEM_LOCALTIME
24 USE_SYSTEM_GMTIME
25 Should we use the system functions if the time is inside their range?
9af24521 26*/
7bda3dfc
MS
27#define SYSTEM_LOCALTIME_MAX 2147483647 /* XXX Replace with LOCALTIME_MAX */
28#define SYSTEM_LOCALTIME_MIN -2147483647 /* XXX Replace with LOCALTIME_MIN */
a64acb40
MS
29#define SYSTEM_GMTIME_MAX GMTIME_MAX
30#define SYSTEM_GMTIME_MIN GMTIME_MIN
31
32/* It'll be faster */
33#define USE_SYSTEM_LOCALTIME 1
34
35/* No point risking system bugs, ours works fine */
36#define USE_SYSTEM_GMTIME 0
9af24521
MS
37
38
39/* 64 bit types. Set as appropriate for your system. */
40typedef Quad_t Time64_T;
41typedef Quad_t Int64;
42
43struct tm *gmtime64_r (const Time64_T *, struct tm *);
44struct tm *localtime64_r (const Time64_T *, struct tm *);
ea722b76 45Time64_T timegm64 (struct tm *);
a272e669
MS
46
47#endif