summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/mktime.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/libntp/mktime.c')
-rw-r--r--contrib/ntp/libntp/mktime.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/ntp/libntp/mktime.c b/contrib/ntp/libntp/mktime.c
index 91be600..50d2a08 100644
--- a/contrib/ntp/libntp/mktime.c
+++ b/contrib/ntp/libntp/mktime.c
@@ -59,9 +59,14 @@
* by hand. Sorry about that.
*/
+#include <config.h>
#include "ntp_machine.h"
-#if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
+#if !defined(HAVE_MKTIME) || ( !defined(HAVE_TIMEGM) && defined(WANT_TIMEGM) )
+
+#if SIZEOF_TIME_T >= 8
+#error libntp supplied mktime()/timegm() do not support 64-bit time_t
+#endif
#ifndef DSTMINUTES
#define DSTMINUTES 60
@@ -226,9 +231,9 @@ time2(
t = (t < 0) ? 0 : ((time_t) 1 << bits);
for ( ; ; ) {
if (usezn)
- mytm = *localtime(&t);
+ mytm = *localtime(&t);
else
- mytm = *gmtime(&t);
+ mytm = *gmtime(&t);
dir = tmcomp(&mytm, &yourtm);
if (dir != 0) {
if (bits-- < 0)
@@ -284,6 +289,7 @@ mktime(
}
#endif /* !HAVE_MKTIME */
+#ifdef WANT_TIMEGM
#ifndef HAVE_TIMEGM
time_t
timegm(
@@ -301,3 +307,4 @@ timegm(
return WRONG;
}
#endif /* !HAVE_TIMEGM */
+#endif /* WANT_TIMEGM */
OpenPOWER on IntegriCloud