Don't include <config.h> twice; this doesn't work in some cases,
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 8 Oct 2006 07:24:56 +0000 (07:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 8 Oct 2006 07:24:56 +0000 (07:24 +0000)
e.g., when config.h has "#define intmax_t long long int" and
we include <config.h>, <inttypes.h>, <config.h> in that order.
* fprintftime.c: Don't include config.h or fprintftime.h.
* fts-cycle.c: Don't include config.h.
* strftime.c: Include fprintftime.h if FPRINTFTIME is defined.
* xstrtoimax.c: Remove copyright notice since it's short tnow.
Don't include config.h or xstrtol.h.  Define STRTOL_T_MINIMUM
and STRTOL_T_MAXIMUM unconditionally, since we now assume gnulib
inttypes.h.
* xstrtoumax.c: Likewise.
* xstrtol.c: Include config.h and xstrtol.h after defining
__strtol and the like, so that this module is more like its siblings.
(STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [! defined STRTOL_T_MINIMUM]:
Remove; no longer needed now that we assume gnulib inttypes.h.

2006-10-07  Bruno Haible  <bruno@clisp.org>

lib/ChangeLog
lib/fprintftime.c
lib/fts-cycle.c
lib/strftime.c
lib/xstrtoimax.c
lib/xstrtol.c
lib/xstrtoumax.c

index 4002832..08fc829 100644 (file)
@@ -1,4 +1,22 @@
-2006-10-03  Bruno Haible  <bruno@clisp.org>
+2006-10-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't include <config.h> twice; this doesn't work in some cases,
+       e.g., when config.h has "#define intmax_t long long int" and
+       we include <config.h>, <inttypes.h>, <config.h> in that order.
+       * fprintftime.c: Don't include config.h or fprintftime.h.
+       * fts-cycle.c: Don't include config.h.
+       * strftime.c: Include fprintftime.h if FPRINTFTIME is defined.
+       * xstrtoimax.c: Remove copyright notice since it's short tnow.
+       Don't include config.h or xstrtol.h.  Define STRTOL_T_MINIMUM
+       and STRTOL_T_MAXIMUM unconditionally, since we now assume gnulib
+       inttypes.h.
+       * xstrtoumax.c: Likewise.
+       * xstrtol.c: Include config.h and xstrtol.h after defining
+       __strtol and the like, so that this module is more like its siblings.
+       (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [! defined STRTOL_T_MINIMUM]:
+       Remove; no longer needed now that we assume gnulib inttypes.h.
+
+2006-10-07  Bruno Haible  <bruno@clisp.org>
 
        * gl_sublist.h: New file.
        * gl_sublist.c: New file.
index 2a45527..e6eb4f2 100644 (file)
@@ -1,5 +1,2 @@
-#include <config.h>
-
-#include "fprintftime.h"
 #define FPRINTFTIME 1
 #include "strftime.c"
index a5f38ab..8edf26e 100644 (file)
@@ -18,8 +18,6 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#include <config.h>
-
 #include "cycle-check.h"
 #include "hash.h"
 
index 86cd1cf..ffa51c0 100644 (file)
@@ -30,6 +30,9 @@
 # include "../locale/localeinfo.h"
 #else
 # include <config.h>
+# if FPRINTFTIME
+#  include "fprintftime.h"
+# endif
 #endif
 
 #include <ctype.h>
index 37b30d8..b4baf5b 100644 (file)
@@ -1,32 +1,6 @@
-/* xstrtoimax.c -- A more useful interface to strtoimax.
-
-   Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-/* Cloned by Jim Meyering. */
-
-#include <config.h>
-
-#include "xstrtol.h"
-
 #define __strtol strtoimax
 #define __strtol_t intmax_t
 #define __xstrtol xstrtoimax
-#ifdef INTMAX_MAX
-# define STRTOL_T_MINIMUM INTMAX_MIN
-# define STRTOL_T_MAXIMUM INTMAX_MAX
-#endif
+#define STRTOL_T_MINIMUM INTMAX_MIN
+#define STRTOL_T_MAXIMUM INTMAX_MAX
 #include "xstrtol.c"
index 2d1ba91..c4557a0 100644 (file)
 
 /* Written by Jim Meyering. */
 
-#include <config.h>
-
-#include "xstrtol.h"
-
 #ifndef __strtol
 # define __strtol strtol
 # define __strtol_t long int
 # define STRTOL_T_MAXIMUM LONG_MAX
 #endif
 
+#include <config.h>
+
+#include "xstrtol.h"
+
 /* Some pre-ANSI implementations (e.g. SunOS 4)
    need stderr defined if assertion checking is enabled.  */
 #include <stdio.h>
 
 #include "intprops.h"
 
-#ifndef STRTOL_T_MINIMUM
-# define STRTOL_T_MINIMUM TYPE_MINIMUM (__strtol_t)
-# define STRTOL_T_MAXIMUM TYPE_MAXIMUM (__strtol_t)
-#endif
-
-#if !HAVE_DECL_STRTOIMAX && !defined strtoimax
-intmax_t strtoimax ();
-#endif
-
-#if !HAVE_DECL_STRTOUMAX && !defined strtoumax
-uintmax_t strtoumax ();
-#endif
-
 static strtol_error
 bkm_scale (__strtol_t *x, int scale_factor)
 {
index 6fb35c7..9a2349f 100644 (file)
@@ -1,32 +1,6 @@
-/* xstrtoumax.c -- A more useful interface to strtoumax.
-
-   Copyright (C) 1999, 2003, 2004, 2006 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-/* Written by Paul Eggert. */
-
-#include <config.h>
-
-#include "xstrtol.h"
-
 #define __strtol strtoumax
 #define __strtol_t uintmax_t
 #define __xstrtol xstrtoumax
-#ifdef UINTMAX_MAX
-# define STRTOL_T_MINIMUM 0
-# define STRTOL_T_MAXIMUM UINTMAX_MAX
-#endif
+#define STRTOL_T_MINIMUM 0
+#define STRTOL_T_MAXIMUM UINTMAX_MAX
 #include "xstrtol.c"