diff options
Diffstat (limited to 'm4/mktime.m4')
-rw-r--r-- | m4/mktime.m4 | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 5e05dfa697..00ee2dabea 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 ()) |