summaryrefslogtreecommitdiff
path: root/lib/timegm.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-05-01 18:36:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-05-01 18:37:01 -0700
commit3707f609cb8017371610a5e2233bd8478416217c (patch)
treefc9ecf2d9754bf95cc33bd9319871d5ebd866fa1 /lib/timegm.c
parent13f4efb0fd5573255c694607552532788ba31c95 (diff)
downloademacs-3707f609cb8017371610a5e2233bd8478416217c.tar.gz
Sync from gnulib
This incorporates: 2016-05-01 mktime: port to stricter signed overflow checking 2016-05-01 mktime: speed up DEBUG_MKTIME benchmarks 2016-05-01 mktime: resurrect DEBUG_MKTIME testing 2016-05-01 mktime: simplify DEBUG_MKTIME 2016-05-01 Port mktime_internal offset to unsigned time_t 2016-04-27 xstrtol: prohibit monstrosities like "1bB" 2016-04-13 mktime: improve integer overflow checking 2016-04-13 intprops: check two's complement assumption 2016-04-13 intprops, mktime, strtol: assume two's complement * lib/intprops.h, lib/mktime-internal.h, lib/mktime.c: * lib/strtol.c, lib/timegm.c, m4/mktime.m4, m4/std-gnu11.m4: Copy from gnulib.
Diffstat (limited to 'lib/timegm.c')
-rw-r--r--lib/timegm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/timegm.c b/lib/timegm.c
index 86bdac3f43e..bf61244acd5 100644
--- a/lib/timegm.c
+++ b/lib/timegm.c
@@ -22,7 +22,9 @@
#include <time.h>
-#ifndef _LIBC
+#ifdef _LIBC
+typedef time_t mktime_offset_t;
+#else
# undef __gmtime_r
# define __gmtime_r gmtime_r
# define __mktime_internal mktime_internal
@@ -32,7 +34,7 @@
time_t
timegm (struct tm *tmp)
{
- static time_t gmtime_offset;
+ static mktime_offset_t gmtime_offset;
tmp->tm_isdst = 0;
return __mktime_internal (tmp, __gmtime_r, &gmtime_offset);
}