summaryrefslogtreecommitdiff
path: root/m4/mktime.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-06-22 10:20:00 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-06-22 10:20:00 -0700
commit057306483c1c7a9216276c51946406c422d60b70 (patch)
treef1bf01008eeaf5b20ed7311e64a3fdec783c9bcf /m4/mktime.m4
parentb57b344b51c06239b4f3584f9ab946dd48c60bb2 (diff)
downloademacs-057306483c1c7a9216276c51946406c422d60b70.tar.gz
Merge from gnulib.
* lib/filemode.h, lib/signal.in.h, lib/stat.c, lib/stdint.in.h: * lib/stdlib.in.h, lib/unistd.in.h, m4/extensions.m4, m4/getloadavg.m4: * m4/getopt.m4, m4/gnulib-common.m4, m4/largefile.m4, m4/mktime.m4: * m4/multiarch.m4, m4/nocrash.m4, m4/stdio_h.m4, m4/time_r.m4: Copy new versions from gnulib, incorporating the following changes: 2012-06-22 time_r: fix typo that always overrode localtime_r decl 2012-06-22 Write "Mac OS X" instead of "MacOS X". 2012-06-21 mktime: fix integer overflow in 'configure'-time test 2012-06-21 nonblocking: Avoid compilation error on mingw64. 2012-06-19 stat, fstat: Avoid warnings on mingw64. 2012-06-19 getopt-gnu: Fix exit code overflow in autoconf test.
Diffstat (limited to 'm4/mktime.m4')
-rw-r--r--m4/mktime.m427
1 files changed, 15 insertions, 12 deletions
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 5e05dfa697e..00ee2dabea5 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
-# serial 21
+# serial 23
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_MKTIME],
AC_CHECK_FUNCS_ONCE([alarm])
AC_REQUIRE([gl_MULTIARCH])
if test $APPLE_UNIVERSAL_BUILD = 1; then
- # A universal build on Apple MacOS X platforms.
+ # A universal build on Apple Mac OS X platforms.
# The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
# But we need a configuration result that is valid in both modes.
gl_cv_func_working_mktime=no
@@ -192,20 +192,23 @@ main ()
if (tz_strings[i])
putenv (tz_strings[i]);
- for (t = 0; t <= time_t_max - delta; t += delta)
+ for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
if (! mktime_test (t))
result |= 1;
- if (! (mktime_test ((time_t) 1)
- && mktime_test ((time_t) (60 * 60))
- && mktime_test ((time_t) (60 * 60 * 24))))
+ if ((result & 2) == 0
+ && ! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
result |= 2;
- for (j = 1; ; j <<= 1)
- if (! bigtime_test (j))
- result |= 4;
- else if (INT_MAX / 2 < j)
- break;
- if (! bigtime_test (INT_MAX))
+ for (j = 1; (result & 4) == 0; j <<= 1)
+ {
+ if (! bigtime_test (j))
+ result |= 4;
+ if (INT_MAX / 2 < j)
+ break;
+ }
+ if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
result |= 8;
}
if (! irix_6_4_bug ())