Split the double-inclusion guard. Fixes a problem with #include_next.
authorBruno Haible <bruno@clisp.org>
Wed, 30 May 2007 02:16:51 +0000 (02:16 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 30 May 2007 02:16:51 +0000 (02:16 +0000)
24 files changed:
ChangeLog
lib/dirent_.h
lib/fcntl_.h
lib/float_.h
lib/iconv_.h
lib/inttypes_.h
lib/locale_.h
lib/math_.h
lib/netinet_in_.h
lib/search_.h
lib/signal_.h
lib/stdint_.h
lib/stdio_.h
lib/stdlib_.h
lib/string_.h
lib/sys_select_.h
lib/sys_socket_.h
lib/sys_stat_.h
lib/sys_time_.h
lib/sysexits_.h
lib/time_.h
lib/unistd_.h
lib/wchar_.h
lib/wctype_.h

index 979aefc564950256c5e89cfe988d8f633611ccc0..e9eb64d0717a09def86bff9e55dac41733bc1907 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2007-05-29  Bruno Haible  <bruno@clisp.org>
+
+       Fix a problem with #include_next.
+       * lib/dirent_.h: Split the double-inclusion guard.
+       * lib/fcntl_.h: Likewise.
+       * lib/float_.h: Likewise.
+       * lib/iconv_.h: Likewise.
+       * lib/inttypes_.h: Likewise.
+       * lib/locale_.h: Likewise.
+       * lib/math_.h: Likewise.
+       * lib/netinet_in_.h: Likewise.
+       * lib/search_.h: Likewise.
+       * lib/signal_.h: Likewise.
+       * lib/stdint_.h: Likewise.
+       * lib/stdio_.h: Likewise.
+       * lib/stdlib_.h: Likewise.
+       * lib/string_.h: Likewise.
+       * lib/sys_select_.h: Likewise.
+       * lib/sys_socket_.h: Likewise.
+       * lib/sys_stat_.h: Likewise.
+       * lib/sys_time_.h: Likewise.
+       * lib/sysexits_.h: Likewise.
+       * lib/time_.h: Likewise.
+       * lib/unistd_.h: Likewise.
+       * lib/wchar_.h: Likewise.
+       * lib/wctype_.h: Likewise.
+
 2007-05-29  Bruno Haible  <bruno@clisp.org>
 
        * tests/test-unistd.c: Disable the tests for useconds_t and intptr_t
index 371aeacdcf51da1da0a6e90860d0b81973e4a7e0..94e44fc104db744e06b03ff6fa3efa3433afce68 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_DIRENT_H
-#define _GL_DIRENT_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <dirent.h>
 #else
 # include @ABSOLUTE_DIRENT_H@
 #endif
 
+#ifndef _GL_DIRENT_H
+#define _GL_DIRENT_H
+
+
 /* Declare overridden functions.  */
 
 #ifdef __cplusplus
@@ -43,3 +47,4 @@ extern int closedir (DIR *);
 
 
 #endif /* _GL_DIRENT_H */
+#endif /* _GL_DIRENT_H */
index 98e13720052217afddba75bc6db420ae39be5b1f..1330cde7bd0edbe6629aa4e64f753a97a0666311 100644 (file)
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007 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
 /* written by Paul Eggert */
 
 #ifndef _GL_FCNTL_H
-#define _GL_FCNTL_H
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <fcntl.h>
 #else
 # include @ABSOLUTE_FCNTL_H@
 #endif
 
+#ifndef _GL_FCNTL_H
+#define _GL_FCNTL_H
+
 
 /* Declare overridden functions.  */
 
@@ -117,4 +120,6 @@ extern int open (const char *, int, ...);
 # define O_TEXT 0
 #endif
 
-#endif
+
+#endif /* _GL_FCNTL_H */
+#endif /* _GL_FCNTL_H */
index 9b2ddaa6ed9863e0beb6478a2b48e5bb2971f360..d898d85add2c61bd191f2cbf0e8066ec295daf88 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_FLOAT_H
-#define _GL_FLOAT_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <float.h>
 #else
 # include @ABSOLUTE_FLOAT_H@
 #endif
 
+#ifndef _GL_FLOAT_H
+#define _GL_FLOAT_H
+
 /* 'long double' properties.  */
 #if defined __i386__ && defined __BEOS__
 /* Number of mantissa units, in base FLT_RADIX.  */
@@ -57,3 +60,4 @@
 #endif
 
 #endif /* _GL_FLOAT_H */
+#endif /* _GL_FLOAT_H */
index a980e40855a1418ae74002d28c51fe527eaf01fa..745fe2ec65e2062d481ee34bbdd88ff207419480 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_ICONV_H
-#define _GL_ICONV_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <iconv.h>
 #else
 # include @ABSOLUTE_ICONV_H@
 #endif
 
+#ifndef _GL_ICONV_H
+#define _GL_ICONV_H
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -42,4 +45,5 @@ extern iconv_t iconv_open (const char *tocode, const char *fromcode);
 }
 #endif
 
-#endif
+#endif /* _GL_ICONV_H */
+#endif /* _GL_ICONV_H */
index be2bdabbac69a87201b073388c324615a8e73a64..6d78325fc1da156b7cca4042e35807aee97ef999 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+/*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
+ */
+
 /* Include the original <inttypes.h> if it exists, and if this file
    has not been included yet or if this file includes gnulib stdint.h
-   which in turn includes this file.  */
+   which in turn includes this file.
+   The include_next requires a split double-inclusion guard.  */
 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
 # if @HAVE_INTTYPES_H@
 #  if @HAVE_INCLUDE_NEXT@
 #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
 #define INTTYPES_H
 
-/*
- * ISO C 99 <inttypes.h> for platforms that lack it.
- * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
- */
-
 /* Include <stdint.h> or the gnulib replacement.  */
 #include <stdint.h>
 /* Get CHAR_BIT.  */
index e23bd014a87c3276a7202e714e7533b0ba644e2b..377d2b970e2490968d036f4a1d0d6daf2abb0b63 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_LOCALE_H
-#define _GL_LOCALE_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <locale.h>
 #else
 # include @ABSOLUTE_LOCALE_H@
 #endif
 
+#ifndef _GL_LOCALE_H
+#define _GL_LOCALE_H
+
 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
    On systems that don't define it, use the same value as GNU libintl.  */
 #if !defined LC_MESSAGES
@@ -31,3 +34,4 @@
 #endif
 
 #endif /* _GL_LOCALE_H */
+#endif /* _GL_LOCALE_H */
index f617df675b50952c6ed77624b4d649aab35e9b9e..ed4a0eecacdea5d701660d6982b6355737d76ae7 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#ifndef _GL_MATH_H
+
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <math.h>
+#else
+# include @ABSOLUTE_MATH_H@
 #endif
 
 #ifndef _GL_MATH_H
 #define _GL_MATH_H
 
-#if ! @HAVE_INCLUDE_NEXT@
-# include @ABSOLUTE_MATH_H@
-#endif
-
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
@@ -264,4 +265,5 @@ extern int gl_signbitl (long double arg);
 }
 #endif
 
-#endif
+#endif /* _GL_MATH_H */
+#endif /* _GL_MATH_H */
index d46ec78e9b66a8220edbc7f667dfe5abae88f426..2585d33e3ad486c0583fdf8cd654bb5bcdfe60b7 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_NETINET_IN_H
-#define _GL_NETINET_IN_H
 
 #if @HAVE_NETINET_IN_H@
 
 /* On many platforms, <netinet/in.h> assumes prior inclusion of
    <sys/types.h>.  */
-
 # include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard.  */
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <netinet/in.h>
 # else
 #  include @ABSOLUTE_NETINET_IN_H@
 # endif
-#else
+
+#endif
+
+#ifndef _GL_NETINET_IN_H
+#define _GL_NETINET_IN_H
+
+#if !@HAVE_NETINET_IN_H@
 
 /* A platform that lacks <netinet/in.h>.  */
 
@@ -38,3 +44,4 @@
 #endif
 
 #endif /* _GL_NETINET_IN_H */
+#endif /* _GL_NETINET_IN_H */
index 3ab086371c19fa518aec087e1f4317cb6cc0adc0..7cc249b924bd27ae23336ab41f499b2d43dbb71b 100644 (file)
@@ -17,8 +17,8 @@
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_SEARCH_H
-#define _GL_SEARCH_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SEARCH_H@
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <search.h>
@@ -27,6 +27,9 @@
 # endif
 #endif
 
+#ifndef _GL_SEARCH_H
+#define _GL_SEARCH_H
+
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
@@ -112,4 +115,5 @@ extern void twalk (const void *vroot,
 }
 #endif
 
-#endif
+#endif /* _GL_SEARCH_H */
+#endif /* _GL_SEARCH_H */
index 3dc743dbea54f3cec79aae97ee68a64717158801..640e811cf4b9f51007f0d178970166b5dc1bebf2 100644 (file)
 /* Normal invocation convention.  */
 
 #ifndef _GL_SIGNAL_H
-#define _GL_SIGNAL_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <signal.h>
 #else
 # include @ABSOLUTE_SIGNAL_H@
 #endif
 
+#ifndef _GL_SIGNAL_H
+#define _GL_SIGNAL_H
+
 /* The definition of GL_LINK_WARNING is copied here.  */
 
 
@@ -98,5 +101,6 @@ extern int sigprocmask (int operation, const sigset_t *set, sigset_t *old_set);
 }
 #endif
 
+#endif /* _GL_SIGNAL_H */
 #endif /* _GL_SIGNAL_H */
 #endif
index f32b8dc882abf2324b7230e628d691fa3d6a9827..d374535c96eb2cefcc9015bc206351c46a5666eb 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_STDINT_H
-#define _GL_STDINT_H
-
 /*
  * ISO C 99 <stdint.h> for platforms that lack it.
  * <http://www.opengroup.org/susv3xbd/stdint.h.html>
  */
 
+#ifndef _GL_STDINT_H
+
 /* Get those types that are already defined in other system include
    files, so that we can "#define int8_t signed char" below without
    worrying about a later system include file containing a "typedef
@@ -42,7 +41,8 @@
   /* Other systems may have an incomplete or buggy <stdint.h>.
      Include it before <inttypes.h>, since any "#include <stdint.h>"
      in <inttypes.h> would reinclude us, skipping our contents because
-     _GL_STDINT_H is defined.  */
+     _GL_STDINT_H is defined.
+     The include_next requires a split double-inclusion guard.  */
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <stdint.h>
 # else
@@ -50,6 +50,9 @@
 # endif
 #endif
 
+#ifndef _GL_STDINT_H
+#define _GL_STDINT_H
+
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
 #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
 
 #endif /* _GL_STDINT_H */
+#endif /* _GL_STDINT_H */
index df41c2e9b5cbff899e13fc294ab37bf64fb865a9..7afaedeede336520791033300c441d5cafc3b0d7 100644 (file)
 #else
 /* Normal invocation convention.  */
 
+#ifndef _GL_STDIO_H
+
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <stdio.h>
+#else
+# include @ABSOLUTE_STDIO_H@
 #endif
 
 #ifndef _GL_STDIO_H
 #define _GL_STDIO_H
 
-#if ! @HAVE_INCLUDE_NEXT@
-# include @ABSOLUTE_STDIO_H@
-#endif
-
 #include <stdarg.h>
 #include <stddef.h>
 
@@ -314,5 +315,6 @@ extern long rpl_ftell (FILE *fp);
 }
 #endif
 
+#endif /* _GL_STDIO_H */
 #endif /* _GL_STDIO_H */
 #endif
index ea429c061be3dc949670ec3b1a988704c6e86e9e..130f071a54a20dcc3354232dcef512c808e32707 100644 (file)
 #else
 /* Normal invocation convention.  */
 
+#ifndef _GL_STDLIB_H
+
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <stdlib.h>
+#else
+# include @ABSOLUTE_STDLIB_H@
 #endif
 
 #ifndef _GL_STDLIB_H
 #define _GL_STDLIB_H
 
-#if ! @HAVE_INCLUDE_NEXT@
-# include @ABSOLUTE_STDLIB_H@
-#endif
-
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
@@ -134,5 +135,6 @@ extern int mkstemp (char * /*template*/);
 }
 #endif
 
+#endif /* _GL_STDLIB_H */
 #endif /* _GL_STDLIB_H */
 #endif
index 43801e823ef4fe1e42f89e011e32cb11c5ed9576..6ec72c3e7f5670631df39b611209c335a7aedfa0 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#ifndef _GL_STRING_H
+
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <string.h>
+#else
+# include @ABSOLUTE_STRING_H@
 #endif
 
 #ifndef _GL_STRING_H
 #define _GL_STRING_H
 
-#if ! @HAVE_INCLUDE_NEXT@
-# include @ABSOLUTE_STRING_H@
-#endif
-
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
@@ -541,4 +542,5 @@ extern char * mbstok_r (char *string, const char *delim, char **save_ptr);
 }
 #endif
 
-#endif
+#endif /* _GL_STRING_H */
+#endif /* _GL_STRING_H */
index c1c2a9e12d7916cac27ffd8f86141e03a41afc24..0d575da95d2259d9bf1e3772fbd59c3716e061ef 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_SYS_SELECT_H
-#define _GL_SYS_SELECT_H
 
 #if @HAVE_SYS_SELECT_H@
 
 /* On many platforms, <sys/select.h> assumes prior inclusion of
    <sys/types.h>.  */
-
 # include <sys/types.h>
 
+/* The include_next requires a split double-inclusion guard.  */
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <sys/select.h>
 # else
 #  include @ABSOLUTE_SYS_SELECT_H@
 # endif
 
-#else
+#endif
+
+#ifndef _GL_SYS_SELECT_H
+#define _GL_SYS_SELECT_H
+
+#if !@HAVE_SYS_SELECT_H@
 
 /* A platform that lacks <sys/select.h>.  */
 
@@ -40,3 +44,4 @@
 #endif
 
 #endif /* _GL_SYS_SELECT_H */
+#endif /* _GL_SYS_SELECT_H */
index 7ad5bca09aff0948016c5aaf395f2260dc8b50d1..c7eb649025f3e28381abaa802ffe1b26d99e7e2d 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_SYS_SOCKET_H
-#define _GL_SYS_SOCKET_H
-
 /* This file is supposed to be used on platforms that lack <sys/socket.h>
    and on platforms where <sys/socket.h> cannot be included standalone.
    It is intended to provide definitions and prototypes needed by an
    application.  */
 
+#ifndef _GL_SYS_SOCKET_H
+
 #if @HAVE_SYS_SOCKET_H@
 
 /* On many platforms, <sys/socket.h> assumes prior inclusion of
    <sys/types.h>.  */
-
 # include <sys/types.h>
 
+/* The include_next requires a split double-inclusion guard.  */
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <sys/socket.h>
 # else
 #  include @ABSOLUTE_SYS_SOCKET_H@
 # endif
 
-#else
+#endif
+
+#ifndef _GL_SYS_SOCKET_H
+#define _GL_SYS_SOCKET_H
+
+#if !@HAVE_SYS_SOCKET_H@
 
 /* A platform that lacks <sys/socket.h>.
 
@@ -88,3 +92,4 @@
 #endif /* HAVE_SYS_SOCKET_H */
 
 #endif /* _GL_SYS_SOCKET_H */
+#endif /* _GL_SYS_SOCKET_H */
index 20bd5ae1e519b8a093a84e69d60d6b402ea256ac..13333d33ab0c684d64eeab39c5cec34b19f2041e 100644 (file)
 
 /* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
 
-#ifndef _GL_SYS_STAT_H
-#define _GL_SYS_STAT_H
-
 /* This file is supposed to be used on platforms where <sys/stat.h> is
    incomplete.  It is intended to provide definitions and prototypes
    needed by an application.  Start with what the system provides.  */
 
+#ifndef _GL_SYS_STAT_H
+
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
 # include_next <sys/stat.h>
 #else
 # include @ABSOLUTE_SYS_STAT_H@
 #endif
 
+#ifndef _GL_SYS_STAT_H
+#define _GL_SYS_STAT_H
+
 #ifndef S_IFMT
 # define S_IFMT 0170000
 #endif
@@ -278,3 +281,4 @@ rpl_mkdir (char const *name, mode_t mode)
 #endif
 
 #endif /* _GL_SYS_STAT_H */
+#endif /* _GL_SYS_STAT_H */
index 6fe31b5bf2e3d522faf8cedf6b2ff4c72572cb7f..253316f7bf5ba7d79099308de0602df260333892 100644 (file)
@@ -19,8 +19,8 @@
 /* Written by Paul Eggert.  */
 
 #ifndef _GL_SYS_TIME_H
-#define _GL_SYS_TIME_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SYS_TIME_H@
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <sys/time.h>
@@ -31,6 +31,9 @@
 # include <time.h>
 #endif
 
+#ifndef _GL_SYS_TIME_H
+#define _GL_SYS_TIME_H
+
 #if ! @HAVE_STRUCT_TIMEVAL@
 struct timeval
 {
@@ -46,3 +49,4 @@ int gettimeofday (struct timeval *restrict, void *restrict);
 #endif
 
 #endif /* _GL_SYS_TIME_H */
+#endif /* _GL_SYS_TIME_H */
index dc63ab344795511ca572189880c8c5bc0a5880f3..ba12aa29e3b7bedc3d40b113c8298291fb982e60 100644 (file)
@@ -18,7 +18,6 @@
 /* Written by Simon Josefsson based on sysexits(3) man page */
 
 #ifndef _GL_SYSEXITS_H
-#define _GL_SYSEXITS_H
 
 #if @HAVE_SYSEXITS_H@
 
@@ -30,6 +29,7 @@
 #  undef EX_OK
 # endif
 
+/* The include_next requires a split double-inclusion guard.  */
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <sysexits.h>
 # else
 #  define EX_CONFIG 78
 # endif
 
-#else
+#endif
+
+#ifndef _GL_SYSEXITS_H
+#define _GL_SYSEXITS_H
+
+#if !@HAVE_SYSEXITS_H@
 
 # define EX_OK 0 /* same value as EXIT_SUCCESS */
 
@@ -64,3 +69,4 @@
 #endif
 
 #endif /* _GL_SYSEXITS_H */
+#endif /* _GL_SYSEXITS_H */
index 3300fb82861b429ff025ce2c0d7f4338f5bd2815..9a0507e68775796c0767fef6773c005c1de66167 100644 (file)
 #else
 /* Normal invocation convention.  */
 
-# if @HAVE_INCLUDE_NEXT@
-#  include_next <time.h>
-# endif
-
 # if ! defined _GL_TIME_H
-#  define _GL_TIME_H
 
-#  if ! @HAVE_INCLUDE_NEXT@
+/* The include_next requires a split double-inclusion guard.  */
+#  if @HAVE_INCLUDE_NEXT@
+#   include_next <time.h>
+#  else
 #   include @ABSOLUTE_TIME_H@
 #  endif
 
-#  ifdef __cplusplus
+#  if ! defined _GL_TIME_H
+#   define _GL_TIME_H
+
+#   ifdef __cplusplus
 extern "C" {
-#  endif
+#   endif
 
 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
    Or they define it with the wrong member names or define it in <sys/time.h>
    (e.g., FreeBSD circa 1997).  */
-#  if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
-#   if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
-#    include <sys/time.h>
-#   else
-#    undef timespec
-#    define timespec rpl_timespec
+#   if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
+#    if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+#     include <sys/time.h>
+#    else
+#     undef timespec
+#     define timespec rpl_timespec
 struct timespec
 {
   time_t tv_sec;
   long int tv_nsec;
 };
+#    endif
 #   endif
-#  endif
 
 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
    return -1 and store the remaining time into RMTP.  See
    <http://www.opengroup.org/susv3xsh/nanosleep.html>.  */
-#  if @REPLACE_NANOSLEEP@
-#   define nanosleep rpl_nanosleep
+#   if @REPLACE_NANOSLEEP@
+#    define nanosleep rpl_nanosleep
 int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp);
-#  endif
+#   endif
 
 /* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
    <http://www.opengroup.org/susv3xsh/localtime_r.html> and
    <http://www.opengroup.org/susv3xsh/gmtime_r.html>.  */
-#  if @REPLACE_LOCALTIME_R@
-#   undef localtime_r
-#   define localtime_r rpl_localtime_r
-#   undef gmtime_r
-#   define gmtime_r rpl_gmtime_r
+#   if @REPLACE_LOCALTIME_R@
+#    undef localtime_r
+#    define localtime_r rpl_localtime_r
+#    undef gmtime_r
+#    define gmtime_r rpl_gmtime_r
 struct tm *localtime_r (time_t const *restrict __timer,
                        struct tm *restrict __result);
 struct tm *gmtime_r (time_t const *restrict __timer,
                     struct tm *restrict __result);
-#  endif
+#   endif
 
 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
    the resulting broken-down time into TM.  See
    <http://www.opengroup.org/susv3xsh/strptime.html>.  */
-#  if @REPLACE_STRPTIME@
-#   undef strptime
-#   define strptime rpl_strptime
+#   if @REPLACE_STRPTIME@
+#    undef strptime
+#    define strptime rpl_strptime
 char *strptime (char const *restrict __buf, char const *restrict __format,
                struct tm *restrict __tm);
-#  endif
+#   endif
 
 /* Convert TM to a time_t value, assuming UTC.  */
-#  if @REPLACE_TIMEGM@
-#   undef timegm
-#   define timegm rpl_timegm
+#   if @REPLACE_TIMEGM@
+#    undef timegm
+#    define timegm rpl_timegm
 time_t timegm (struct tm *__tm);
-#  endif
+#   endif
 
 /* Encourage applications to avoid unsafe functions that can overrun
    buffers when given outlandish struct tm values.  Portable
    applications should use strftime (or even sprintf) instead.  */
-#  if GNULIB_PORTCHECK
-#   undef asctime
-#   define asctime eschew_asctime
-#   undef asctime_r
-#   define asctime_r eschew_asctime_r
-#   undef ctime
-#   define ctime eschew_ctime
-#   undef ctime_r
-#   define ctime_r eschew_ctime_r
-#  endif
+#   if GNULIB_PORTCHECK
+#    undef asctime
+#    define asctime eschew_asctime
+#    undef asctime_r
+#    define asctime_r eschew_asctime_r
+#    undef ctime
+#    define ctime eschew_ctime
+#    undef ctime_r
+#    define ctime_r eschew_ctime_r
+#   endif
 
-#  ifdef __cplusplus
+#   ifdef __cplusplus
 }
-#  endif
+#   endif
 
-# endif
+#  endif /* _GL_TIME_H */
+# endif /* _GL_TIME_H */
 #endif
index ad1b265f49f3d526a7c3be47596c88744dc3b4af..f34bc66c1763bba7f0fa3ef91ce106c51b1b6f43 100644 (file)
@@ -16,8 +16,8 @@
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #ifndef _GL_UNISTD_H
-#define _GL_UNISTD_H
 
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <unistd.h>
@@ -26,6 +26,9 @@
 # endif
 #endif
 
+#ifndef _GL_UNISTD_H
+#define _GL_UNISTD_H
+
 /* mingw doesn't define the SEEK_* macros in <unistd.h>.  */
 #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
 # include <stdio.h>
@@ -236,3 +239,4 @@ extern unsigned int sleep (unsigned int n);
 
 
 #endif /* _GL_UNISTD_H */
+#endif /* _GL_UNISTD_H */
index f58af2f147c453c2f92e02082b3dd62e705ba6ff..2a71b8b35e996005a49e1149b872d21bd702a5c5 100644 (file)
  * For now, this just ensures proper prerequisite inclusion order.
  */
 
-#if @HAVE_INCLUDE_NEXT@
-# include <stdio.h>
-# include_next <wchar.h>
-#endif
-
 #ifndef _GL_WCHAR_H
-#define _GL_WCHAR_H
 
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
 #include <time.h>
 
 /* Include the original <wchar.h>.  */
-#if ! @HAVE_INCLUDE_NEXT@
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_INCLUDE_NEXT@
+# include_next <wchar.h>
+#else
 # include @ABSOLUTE_WCHAR_H@
 #endif
 
+#ifndef _GL_WCHAR_H
+#define _GL_WCHAR_H
+
+#endif /* _GL_WCHAR_H */
 #endif /* _GL_WCHAR_H */
index 3ca41a7bf97cc324bde836f15b3d2acb1373d29a..ebbfca4b03dc1e7ebedae61249d74a95196c5470 100644 (file)
@@ -26,6 +26,8 @@
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
+#ifndef _GL_WCTYPE_H
+
 #if @HAVE_WINT_T@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
    Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
 # include <wchar.h>
 #endif
 
+/* Include the original <wctype.h> if it exists.
+   BeOS 5 has the functions but no <wctype.h>.  */
+/* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_WCTYPE_H@
 # if @HAVE_INCLUDE_NEXT@
 #  include_next <wctype.h>
+# else
+#  include @ABSOLUTE_WCTYPE_H@
 # endif
 #endif
 
 #ifndef _GL_WCTYPE_H
 #define _GL_WCTYPE_H
 
-/* Include the original <wctype.h> if it exists.
-   BeOS 5 has the functions but no <wctype.h>.  */
-#if @HAVE_WCTYPE_H@
-# if ! @HAVE_INCLUDE_NEXT@
-#  include @ABSOLUTE_WCTYPE_H@
-# endif
-#endif
-
 #if @HAVE_WINT_T@
 typedef wint_t __wctype_wint_t;
 #else
@@ -163,3 +162,4 @@ iswxdigit (__wctype_wint_t wc)
 # endif /* ! HAVE_ISWCNTRL */
 
 #endif /* _GL_WCTYPE_H */
+#endif /* _GL_WCTYPE_H */