19 #define GRANDPARENTED "Local time zone must be set--see zic manual page"
26 #ifndef HAVE_DECL_ASCTIME_R
27 #define HAVE_DECL_ASCTIME_R 1
31 #define HAVE_GETTEXT 0
34 #ifndef HAVE_INCOMPATIBLE_CTIME_R
35 #define HAVE_INCOMPATIBLE_CTIME_R 0
42 #ifndef HAVE_POSIX_DECLS
43 #define HAVE_POSIX_DECLS 1
51 #define HAVE_SYMLINK 1
54 #ifndef HAVE_SYS_STAT_H
55 #define HAVE_SYS_STAT_H 1
58 #ifndef HAVE_SYS_WAIT_H
59 #define HAVE_SYS_WAIT_H 1
63 #define HAVE_UNISTD_H 1
67 #define HAVE_UTMPX_H 1
70 #ifndef NETBSD_INSPIRED
71 # define NETBSD_INSPIRED 1
74 #if HAVE_INCOMPATIBLE_CTIME_R
75 #define asctime_r _incompatible_asctime_r
76 #define ctime_r _incompatible_ctime_r
82 #define _POSIX_PTHREAD_SEMANTICS 1
84 #define __EXTENSIONS__ 1
91 #define localtime_rz sys_localtime_rz
92 #define mktime_z sys_mktime_z
93 #define posix2time_z sys_posix2time_z
94 #define time2posix_z sys_time2posix_z
95 #define timezone_t sys_timezone_t
96 #define tzalloc sys_tzalloc
97 #define tzfree sys_tzfree
107 #include "sys/types.h"
116 # define ENAMETOOLONG EINVAL
119 # define ENOTSUP EINVAL
122 # define EOVERFLOW EINVAL
130 #include <sys/wait.h>
134 #define WIFEXITED(status) (((status) & 0xff) == 0)
137 #define WEXITSTATUS(status) (((status) >> 8) & 0xff)
144 #ifndef HAVE_STRFTIME_L
145 # if _POSIX_VERSION < 200809
146 # define HAVE_STRFTIME_L 0
148 # define HAVE_STRFTIME_L 1
160 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
168 #ifndef HAVE_STDINT_H
169 #define HAVE_STDINT_H \
170 (199901 <= __STDC_VERSION__ \
171 || 2 < __GLIBC__ + (1 <= __GLIBC_MINOR__) \
172 || __CYGWIN__ || INTMAX_MAX)
179 #ifndef HAVE_INTTYPES_H
180 # define HAVE_INTTYPES_H HAVE_STDINT_H
183 # include <inttypes.h>
187 #ifdef __LONG_LONG_MAX__
189 # define LLONG_MAX __LONG_LONG_MAX__
192 # define LLONG_MIN (-1 - LLONG_MAX)
196 #ifndef INT_FAST64_MAX
199 # define INT_FAST64_MIN LLONG_MIN
200 # define INT_FAST64_MAX LLONG_MAX
202 # if LONG_MAX >> 31 < 0xffffffff
203 Please use a compiler that supports a 64-bit integer
type (or wider);
204 you may need to compile with
"-DHAVE_STDINT_H".
207 # define INT_FAST64_MIN LONG_MIN
208 # define INT_FAST64_MAX LONG_MAX
213 # if INT_FAST64_MAX == LLONG_MAX
214 # define PRIdFAST64 "lld"
216 # define PRIdFAST64 "ld"
221 # define SCNdFAST64 PRIdFAST64
224 #ifndef INT_FAST32_MAX
225 # if INT_MAX >> 31 == 0
227 # define INT_FAST32_MAX LONG_MAX
228 # define INT_FAST32_MIN LONG_MIN
231 # define INT_FAST32_MAX INT_MAX
232 # define INT_FAST32_MIN INT_MIN
239 # define strtoimax strtoll
240 # define INTMAX_MAX LLONG_MAX
241 # define INTMAX_MIN LLONG_MIN
244 # define strtoimax strtol
245 # define INTMAX_MAX LONG_MAX
246 # define INTMAX_MIN LONG_MIN
251 # if INTMAX_MAX == LLONG_MAX
252 # define PRIdMAX "lld"
254 # define PRIdMAX "ld"
258 #ifndef UINT_FAST64_MAX
259 # if defined ULLONG_MAX || defined __LONG_LONG_MAX__
262 # if ULONG_MAX >> 31 >> 1 < 0xffffffff
263 Please use a compiler that supports a 64-bit integer
type (or wider);
264 you may need to compile with
"-DHAVE_STDINT_H".
271 # if defined ULLONG_MAX || defined __LONG_LONG_MAX__
279 # if defined ULLONG_MAX || defined __LONG_LONG_MAX__
280 # define PRIuMAX "llu"
282 # define PRIuMAX "lu"
287 #define INT32_MAX 0x7fffffff
290 #define INT32_MIN (-1 - INT32_MAX)
294 #define SIZE_MAX ((size_t) -1)
297 #if 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
298 # define ATTRIBUTE_CONST __attribute__ ((const))
299 # define ATTRIBUTE_PURE __attribute__ ((__pure__))
300 # define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
302 # define ATTRIBUTE_CONST
303 # define ATTRIBUTE_PURE
304 # define ATTRIBUTE_FORMAT(spec)
307 #if !defined _Noreturn && __STDC_VERSION__ < 201112
308 # if 2 < __GNUC__ + (8 <= __GNUC_MINOR__)
309 # define _Noreturn __attribute__ ((__noreturn__))
315 #if __STDC_VERSION__ < 199901 && !defined restrict
324 # define EPOCH_LOCAL 0
327 # define EPOCH_OFFSET 0
337 #if defined time_tz || EPOCH_LOCAL || EPOCH_OFFSET != 0
338 # ifdef LOCALTIME_IMPLEMENTATION
339 static time_t sys_time(time_t *x) {
return time(x); }
342 typedef time_tz tz_time_t;
345 # define ctime tz_ctime
347 # define ctime_r tz_ctime_r
349 # define difftime tz_difftime
351 # define gmtime tz_gmtime
353 # define gmtime_r tz_gmtime_r
355 # define localtime tz_localtime
357 # define localtime_r tz_localtime_r
359 # define localtime_rz tz_localtime_rz
361 # define mktime tz_mktime
363 # define mktime_z tz_mktime_z
365 # define offtime tz_offtime
367 # define posix2time tz_posix2time
369 # define posix2time_z tz_posix2time_z
371 # define time tz_time
373 # define time2posix tz_time2posix
375 # define time2posix_z tz_time2posix_z
377 # define time_t tz_time_t
379 # define timegm tz_timegm
381 # define timelocal tz_timelocal
383 # define timeoff tz_timeoff
385 # define tzalloc tz_tzalloc
387 # define tzfree tz_tzfree
389 # define tzset tz_tzset
391 # define tzsetwall tz_tzsetwall
393 char *
ctime(time_t
const *);
394 char *
ctime_r(time_t
const *,
char *);
401 time_t time(time_t *);
405 #if !HAVE_DECL_ASCTIME_R && !defined asctime_r
409 #if !HAVE_POSIX_DECLS
412 extern long timezone;
420 #if defined ALTZONE && !defined altzone
430 # if !defined tzsetwall || defined time_tz
431 void tzsetwall(
void);
433 # if !defined offtime || defined time_tz
434 struct tm *offtime(time_t
const *,
long);
436 # if !defined timegm || defined time_tz
437 time_t timegm(
struct tm *);
439 # if !defined timelocal || defined time_tz
440 time_t timelocal(
struct tm *);
442 # if !defined timeoff || defined time_tz
443 time_t timeoff(
struct tm *,
long);
445 # if !defined time2posix || defined time_tz
446 time_t time2posix(time_t);
448 # if !defined posix2time || defined time_tz
449 time_t posix2time(time_t);
455 #if (defined __GLIBC__ \
456 || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ \
457 || (defined __APPLE__ && defined __MACH__))
458 # if !defined TM_GMTOFF && !defined NO_TM_GMTOFF
459 # define TM_GMTOFF tm_gmtoff
461 # if !defined TM_ZONE && !defined NO_TM_ZONE
462 # define TM_ZONE tm_zone
477 struct tm *restrict);
479 timezone_t
tzalloc(
char const *);
482 # if !defined posix2time_z || defined time_tz
485 # if !defined time2posix_z || defined time_tz
495 #if __STDC_VERSION__ < 199901
500 # include <stdbool.h>
504 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
508 #define TYPE_SIGNED(type) (((type) -1) < 0)
511 #define TWOS_COMPLEMENT(t) ((t) ~ (t) 0 < 0)
516 #define MAXVAL(t, b) \
517 ((t) (((t) 1 << ((b) - 1 - TYPE_SIGNED(t))) \
518 - 1 + ((t) 1 << ((b) - 1 - TYPE_SIGNED(t)))))
519 #define MINVAL(t, b) \
520 ((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0))
525 #if 201112 <= __STDC_VERSION__
528 ? _Generic((time_t) 0,
529 signed char: SCHAR_MIN,
short: SHRT_MIN,
530 int: INT_MIN,
long: LONG_MIN,
long long: LLONG_MIN,
535 ? _Generic((time_t) 0,
536 signed char: SCHAR_MAX,
short: SHRT_MAX,
537 int: INT_MAX,
long: LONG_MAX,
long long: LLONG_MAX,
545 #ifndef INT_STRLEN_MAXIMUM
552 #define INT_STRLEN_MAXIMUM(type) \
553 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
554 1 + TYPE_SIGNED(type))
562 # define INITIALIZE(x) ((x) = 0)
564 # define INITIALIZE(x)
568 # define UNINIT_TRAP 0
579 #define _(msgid) gettext(msgid)
581 #define _(msgid) msgid
585 #if !defined TZ_DOMAIN && defined HAVE_GETTEXT
586 # define TZ_DOMAIN "tz"
589 #if HAVE_INCOMPATIBLE_CTIME_R
593 char *
ctime_r(time_t
const *,
char *);
596 #ifndef YEARSPERREPEAT
597 #define YEARSPERREPEAT 400
604 #ifndef AVGSECSPERYEAR
605 #define AVGSECSPERYEAR 31556952L
608 #ifndef SECSPERREPEAT
609 #define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
612 #ifndef SECSPERREPEAT_BITS
613 #define SECSPERREPEAT_BITS 34
#define localtime_rz
Definition: private.h:91
char * asctime_r(register const struct tm *timeptr, char *buf)
Definition: asctime.c:72
time_t mktime(struct tm *tmp)
Definition: localtime.c:2118
Please use a compiler that supports a bit integer type(or wider)
void tzset(void)
Definition: localtime.c:1308
#define posix2time_z
Definition: private.h:93
#define restrict
Definition: private.h:316
struct tm * localtime(const time_t *timep)
Definition: localtime.c:1488
struct tm * localtime_r(const time_t *timep, struct tm *tmp)
Definition: localtime.c:1494
static time_t const time_t_min
Definition: private.h:541
unsigned long uintmax_t
Definition: private.h:274
long int_fast32_t
Definition: private.h:226
#define tzalloc
Definition: private.h:96
#define MINVAL(t, b)
Definition: private.h:519
#define mktime_z
Definition: private.h:92
static time_t const time_t_max
Definition: private.h:542
#define time2posix_z
Definition: private.h:94
struct tm * gmtime(const time_t *timep)
Definition: localtime.c:1534
char * ctime_r(const time_t *timep, char *buf)
Definition: localtime.c:1700
#define tzfree
Definition: private.h:97
#define timezone_t
Definition: private.h:95
struct tm * gmtime_r(const time_t *timep, struct tm *tmp)
Definition: localtime.c:1527
long intmax_t
Definition: private.h:243
Definition: localtime.c:122
you may need to compile with DHAVE_STDINT_H typedef unsigned long uint_fast64_t
Definition: private.h:266
#define MAXVAL(t, b)
Definition: private.h:516
double ATTRIBUTE_CONST difftime(time_t time1, time_t time0)
Definition: difftime.c:18
char * ctime(const time_t *timep)
Definition: localtime.c:1687
#define ATTRIBUTE_PURE
Definition: private.h:303
you may need to compile with DHAVE_STDINT_H typedef long int_fast64_t
Definition: private.h:206
#define TYPE_BIT(type)
Definition: private.h:504
static struct tm tm
Definition: localtime.c:189
#define TYPE_SIGNED(type)
Definition: private.h:508