This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update from y2038
[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*/
b9020a0a
MS
27#define SYSTEM_LOCALTIME_MAX LOCALTIME_MAX
28#define SYSTEM_LOCALTIME_MIN LOCALTIME_MIN
a64acb40
MS
29#define SYSTEM_GMTIME_MAX GMTIME_MAX
30#define SYSTEM_GMTIME_MIN GMTIME_MIN
31
750c447b 32/* It'll be faster */
a64acb40 33#define USE_SYSTEM_LOCALTIME 1
b9020a0a 34#define USE_SYSTEM_GMTIME 1
9af24521
MS
35
36
37/* 64 bit types. Set as appropriate for your system. */
38typedef Quad_t Time64_T;
39typedef Quad_t Int64;
750c447b 40typedef Int64 Year;
9af24521
MS
41
42struct tm *gmtime64_r (const Time64_T *, struct tm *);
43struct tm *localtime64_r (const Time64_T *, struct tm *);
ea722b76 44Time64_T timegm64 (struct tm *);
a272e669
MS
45
46#endif