annotate m4/mktime.m4 @ 14249:52b55b447c02

TYPE_MAXIMUM: avoid theoretically undefined behavior * lib/intprops.h (TYPE_MINIMUM, TYPE_MAXIMUM): Do not shift a negative number, which the C Standard says has undefined behavior. In practice this is not a problem, but might as well do it by the book. Reported by Rich Felker and Eric Blake; see <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00493.html>. * lib/strtol.c (TYPE_MINIMUM, TYPE_MAXIMUM): Likewise. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Likewise. * m4/stdint.m4 (gl_STDINT_H): Likewise. * lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 29 Jan 2011 23:59:31 -0800
parents 21a50d7b2537
children 5fcbe73883bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14249
52b55b447c02 TYPE_MAXIMUM: avoid theoretically undefined behavior
Paul Eggert <eggert@cs.ucla.edu>
parents: 14245
diff changeset
1 # serial 19
14079
97fc9a21a8fb maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents: 13918
diff changeset
2 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12421
diff changeset
3 dnl Inc.
5611
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4666
diff changeset
4 dnl This file is free software; the Free Software Foundation
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4666
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4666
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 dnl From Jim Meyering.
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
13695
8a06cdf65b57 Take over the maintenance of some older macros from Autoconf.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
10 # Redefine AC_FUNC_MKTIME, because it is no longer maintained in Autoconf.
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
11 # AC_FUNC_MKTIME
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
12 # --------------
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
13 AC_DEFUN([AC_FUNC_MKTIME],
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 8427
diff changeset
14 [AC_CHECK_HEADERS_ONCE([unistd.h])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 8427
diff changeset
15 AC_CHECK_FUNCS_ONCE([alarm])
11068
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
16 AC_REQUIRE([gl_MULTIARCH])
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
17 if test $APPLE_UNIVERSAL_BUILD = 1; then
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
18 # A universal build on Apple MacOS X platforms.
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
19 # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
20 # But we need a configuration result that is valid in both modes.
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
21 ac_cv_func_working_mktime=no
46ff2eeb7a64 mktime: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents: 11014
diff changeset
22 fi
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 8427
diff changeset
23 AC_CACHE_CHECK([for working mktime], [ac_cv_func_working_mktime],
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
24 [AC_RUN_IFELSE([AC_LANG_SOURCE(
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
25 [[/* Test program from Paul Eggert and Tony Leneis. */
7734
6cc7c62f16f7 * m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7276
diff changeset
26 #include <limits.h>
6275
fd0ccce602e4 Sync from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5611
diff changeset
27 #include <stdlib.h>
7897
b7a83a69ac23 * MODULES.html.sh (Support for systems lacking POSIX:2001): New
Paul Eggert <eggert@cs.ucla.edu>
parents: 7734
diff changeset
28 #include <time.h>
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
29
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
30 #ifdef HAVE_UNISTD_H
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
31 # include <unistd.h>
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
32 #endif
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
33
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
34 #ifndef HAVE_ALARM
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
35 # define alarm(X) /* empty */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
36 #endif
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
37
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
38 /* Work around redefinition to rpl_putenv by other config tests. */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
39 #undef putenv
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
40
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
41 static time_t time_t_max;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
42 static time_t time_t_min;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
43
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
44 /* Values we'll use to set the TZ environment variable. */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
45 static char *tz_strings[] = {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
46 (char *) 0, "TZ=GMT0", "TZ=JST-9",
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
47 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
48 };
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
49 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
50
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
51 /* Return 0 if mktime fails to convert a date in the spring-forward gap.
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
52 Based on a problem report from Andreas Jaeger. */
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
53 static int
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
54 spring_forward_gap ()
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
55 {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
56 /* glibc (up to about 1998-10-07) failed this test. */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
57 struct tm tm;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
58
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
59 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
60 instead of "TZ=America/Vancouver" in order to detect the bug even
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
61 on systems that don't support the Olson extension, or don't have the
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
62 full zoneinfo tables installed. */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
63 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
64
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
65 tm.tm_year = 98;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
66 tm.tm_mon = 3;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
67 tm.tm_mday = 5;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
68 tm.tm_hour = 2;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
69 tm.tm_min = 0;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
70 tm.tm_sec = 0;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
71 tm.tm_isdst = -1;
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
72 return mktime (&tm) != (time_t) -1;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
73 }
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
74
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
75 static int
11014
622b789a86c4 mktime.m4: remove K&R-style function prototypes
Albert Chin-A-Young <china@thewrittenword.com>
parents: 11007
diff changeset
76 mktime_test1 (time_t now)
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
77 {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
78 struct tm *lt;
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
79 return ! (lt = localtime (&now)) || mktime (lt) == now;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
80 }
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
81
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
82 static int
11014
622b789a86c4 mktime.m4: remove K&R-style function prototypes
Albert Chin-A-Young <china@thewrittenword.com>
parents: 11007
diff changeset
83 mktime_test (time_t now)
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
84 {
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
85 return (mktime_test1 (now)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
86 && mktime_test1 ((time_t) (time_t_max - now))
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
87 && mktime_test1 ((time_t) (time_t_min + now)));
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
88 }
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
89
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
90 static int
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
91 irix_6_4_bug ()
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
92 {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
93 /* Based on code from Ariel Faigon. */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
94 struct tm tm;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
95 tm.tm_year = 96;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
96 tm.tm_mon = 3;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
97 tm.tm_mday = 0;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
98 tm.tm_hour = 0;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
99 tm.tm_min = 0;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
100 tm.tm_sec = 0;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
101 tm.tm_isdst = -1;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
102 mktime (&tm);
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
103 return tm.tm_mon == 2 && tm.tm_mday == 31;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
104 }
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
105
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
106 static int
11014
622b789a86c4 mktime.m4: remove K&R-style function prototypes
Albert Chin-A-Young <china@thewrittenword.com>
parents: 11007
diff changeset
107 bigtime_test (int j)
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
108 {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
109 struct tm tm;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
110 time_t now;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
111 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
112 now = mktime (&tm);
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
113 if (now != (time_t) -1)
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
114 {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
115 struct tm *lt = localtime (&now);
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
116 if (! (lt
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
117 && lt->tm_year == tm.tm_year
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
118 && lt->tm_mon == tm.tm_mon
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
119 && lt->tm_mday == tm.tm_mday
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
120 && lt->tm_hour == tm.tm_hour
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
121 && lt->tm_min == tm.tm_min
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
122 && lt->tm_sec == tm.tm_sec
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
123 && lt->tm_yday == tm.tm_yday
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
124 && lt->tm_wday == tm.tm_wday
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
125 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
126 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
127 return 0;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
128 }
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
129 return 1;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
130 }
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
131
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
132 static int
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
133 year_2050_test ()
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
134 {
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
135 /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
136 ignoring leap seconds. */
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
137 unsigned long int answer = 2527315200UL;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
138
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
139 struct tm tm;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
140 time_t t;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
141 tm.tm_year = 2050 - 1900;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
142 tm.tm_mon = 2 - 1;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
143 tm.tm_mday = 1;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
144 tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
145 tm.tm_isdst = -1;
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
146
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
147 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
148 instead of "TZ=America/Vancouver" in order to detect the bug even
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
149 on systems that don't support the Olson extension, or don't have the
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
150 full zoneinfo tables installed. */
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
151 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
152
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
153 t = mktime (&tm);
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
154
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
155 /* Check that the result is either a failure, or close enough
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
156 to the correct answer that we can assume the discrepancy is
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
157 due to leap seconds. */
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
158 return (t == (time_t) -1
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
159 || (0 < t && answer - 120 <= t && t <= answer + 120));
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
160 }
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
161
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
162 int
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
163 main ()
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
164 {
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
165 int result = 0;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
166 time_t t, delta;
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
167 int i, j;
14245
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
168 int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
169 int time_t_signed = ! ((time_t) 0 < (time_t) -1);
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
170
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
171 /* This test makes some buggy mktime implementations loop.
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
172 Give up after 60 seconds; a mktime slower than that
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
173 isn't worth using anyway. */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
174 alarm (60);
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
175
14245
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
176 time_t_max = (! time_t_signed
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
177 ? (time_t) -1
14249
52b55b447c02 TYPE_MAXIMUM: avoid theoretically undefined behavior
Paul Eggert <eggert@cs.ucla.edu>
parents: 14245
diff changeset
178 : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
52b55b447c02 TYPE_MAXIMUM: avoid theoretically undefined behavior
Paul Eggert <eggert@cs.ucla.edu>
parents: 14245
diff changeset
179 * 2 + 1));
14245
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
180 time_t_min = (! time_t_signed
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
181 ? (time_t) 0
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
182 : time_t_signed_magnitude
21a50d7b2537 mktime: avoid infinite loop
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
183 ? ~ (time_t) 0
14249
52b55b447c02 TYPE_MAXIMUM: avoid theoretically undefined behavior
Paul Eggert <eggert@cs.ucla.edu>
parents: 14245
diff changeset
184 : ~ time_t_max);
7734
6cc7c62f16f7 * m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7276
diff changeset
185
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
186 delta = time_t_max / 997; /* a suitable prime number */
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
187 for (i = 0; i < N_STRINGS; i++)
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
188 {
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
189 if (tz_strings[i])
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
190 putenv (tz_strings[i]);
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
191
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
192 for (t = 0; t <= time_t_max - delta; t += delta)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
193 if (! mktime_test (t))
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
194 result |= 1;
7276
4be2c469b318 * config/srclist.txt: Temporarily comment out mktime.c until glibc bug
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
195 if (! (mktime_test ((time_t) 1)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
196 && mktime_test ((time_t) (60 * 60))
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
197 && mktime_test ((time_t) (60 * 60 * 24))))
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
198 result |= 2;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
199
7734
6cc7c62f16f7 * m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7276
diff changeset
200 for (j = 1; ; j <<= 1)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
201 if (! bigtime_test (j))
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
202 result |= 4;
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
203 else if (INT_MAX / 2 < j)
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
204 break;
7734
6cc7c62f16f7 * m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7276
diff changeset
205 if (! bigtime_test (INT_MAX))
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
206 result |= 8;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
207 }
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
208 if (! irix_6_4_bug ())
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
209 result |= 16;
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
210 if (! spring_forward_gap ())
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
211 result |= 32;
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
212 if (! year_2050_test ())
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
213 result |= 64;
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 13695
diff changeset
214 return result;
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
215 }]])],
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
216 [ac_cv_func_working_mktime=yes],
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
217 [ac_cv_func_working_mktime=no],
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11744
diff changeset
218 [ac_cv_func_working_mktime=no])])
4348
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
219 if test $ac_cv_func_working_mktime = no; then
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
220 AC_LIBOBJ([mktime])
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
221 fi
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
222 ])# AC_FUNC_MKTIME
fc8667232bcc Ensure we use gnulib mktime rather than glibc's mktime, on hosts
Paul Eggert <eggert@cs.ucla.edu>
parents: 4107
diff changeset
223
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
224 AC_DEFUN([gl_FUNC_MKTIME],
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
225 [
11742
531d4547f010 Fix compilation error when <ctime> is used and mktime is replaced.
Bruno Haible <bruno@clisp.org>
parents: 11068
diff changeset
226 AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
7942
9b53e406b401 2007-01-24 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents: 7906
diff changeset
227 AC_FUNC_MKTIME
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 8427
diff changeset
228 dnl Note: AC_FUNC_MKTIME does AC_LIBOBJ([mktime]).
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
229 if test $ac_cv_func_working_mktime = no; then
11742
531d4547f010 Fix compilation error when <ctime> is used and mktime is replaced.
Bruno Haible <bruno@clisp.org>
parents: 11068
diff changeset
230 REPLACE_MKTIME=1
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
231 gl_PREREQ_MKTIME
11744
6fff409b3230 mktime: correct setting of REPLACE_MKTIME
Jim Meyering <meyering@redhat.com>
parents: 11742
diff changeset
232 else
6fff409b3230 mktime: correct setting of REPLACE_MKTIME
Jim Meyering <meyering@redhat.com>
parents: 11742
diff changeset
233 REPLACE_MKTIME=0
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
234 fi
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
235 ])
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
236
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
237 # Prerequisites of lib/mktime.c.
8427
8bd2ba354a25 mktime.c requires 'inline'.
Bruno Haible <bruno@clisp.org>
parents: 7942
diff changeset
238 AC_DEFUN([gl_PREREQ_MKTIME],
8bd2ba354a25 mktime.c requires 'inline'.
Bruno Haible <bruno@clisp.org>
parents: 7942
diff changeset
239 [
8bd2ba354a25 mktime.c requires 'inline'.
Bruno Haible <bruno@clisp.org>
parents: 7942
diff changeset
240 AC_REQUIRE([AC_C_INLINE])
8bd2ba354a25 mktime.c requires 'inline'.
Bruno Haible <bruno@clisp.org>
parents: 7942
diff changeset
241 ])