* lib/inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 28 Aug 2006 20:42:17 +0000 (20:42 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 28 Aug 2006 20:42:17 +0000 (20:42 +0000)
Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
* lib/stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
just before including <inttypes.h>, to avoid circular inclusion.
* m4/inttypes.m4 (gl_INTTYPES_H): Move ABSOLUTE_INTTYPES_H code here...
* m4/stdint.m4 (gl_STDINT_H): ... from here.  This undoes the most recent
change to stdint.m4, since we're now addressing the problem in a
different way.
* modules/stdint (Makefile.am): Do not substitute ABSOLUTE_INTTYPES_H.

ChangeLog
lib/ChangeLog
lib/inttypes_.h
lib/stdint_.h
m4/ChangeLog
m4/inttypes.m4
m4/stdint.m4
modules/stdint

index d630233..b663546 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * modules/stdint (Makefile.am): Do not substitute ABSOLUTE_INTTYPES_H.
+       This undoes the most recent change, since we're not addressing the
+       problem in a different way.
+
        * gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
        into output, since the output might be called Makefile.am even
        if $makefile_name is something different.
index 7454d96..b8b8d8b 100644 (file)
@@ -1,3 +1,10 @@
+2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
+       Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
+       * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
+       just before including <inttypes.h>, to avoid circular inclusion.
+
 2006-08-28  Bruno Haible  <bruno@clisp.org>
 
        * inttypes_.h (SCNX*): Remove definitions.
index f9ff39a..96a1806 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 INTTYPES_H
+/* 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.  */
+#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
+# if @HAVE_INTTYPES_H@
+#  include @ABSOLUTE_INTTYPES_H@
+# endif
+#endif
+
+#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
 #define INTTYPES_H
 
 /*
  * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
  */
 
-/* Include the original <inttypes.h> if it exists.  */
-#if @HAVE_INTTYPES_H@
-# include @ABSOLUTE_INTTYPES_H@
-#endif
 /* Include <stdint.h> or the gnulib replacement.  */
 #include <stdint.h>
 /* Get CHAR_BIT.  */
index 9c0c47d..1ada949 100644 (file)
@@ -62,7 +62,9 @@
   /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
      int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
      <inttypes.h> also defines intptr_t and uintptr_t.  */
-# include @ABSOLUTE_INTTYPES_H@
+# define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
+# include <inttypes.h>
+# undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
 #elif @HAVE_SYS_INTTYPES_H@
   /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
      the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
index 8ddf63a..e37b8be 100644 (file)
@@ -1,3 +1,10 @@
+2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * inttypes.m4 (gl_INTTYPES_H): Move ABSOLUTE_INTTYPES_H code here...
+       * stdint.m4 (gl_STDINT_H): ... from here.  This undoes the most recent
+       change to stdint.m4, since we're now addressing the problem in a
+       different way.
+
 2006-08-28  Bruno Haible  <bruno@clisp.org>
 
        * inttypes.m4 (gl_INTTYPES_H): Don't test for the existence of SCNX*
index f2c9eb5..d7f021c 100644 (file)
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 2
+# inttypes.m4 serial 3
 dnl Copyright (C) 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -135,6 +135,15 @@ const char *l = /* implicit string concatenation */
     INTTYPES_H=''
   else
 
+    dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
+    if test $ac_cv_header_inttypes_h = yes; then
+      gl_ABSOLUTE_HEADER([inttypes.h])
+      ABSOLUTE_INTTYPES_H=\"$gl_cv_absolute_inttypes_h\"
+    else
+      ABSOLUTE_INTTYPES_H=\"no/such/file/inttypes.h\"
+    fi
+    AC_SUBST([ABSOLUTE_INTTYPES_H])
+
     PRIPTR_PREFIX=
     if test -n "$STDINT_H"; then
       dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
index b48fb9d..48748c6 100644 (file)
@@ -1,4 +1,4 @@
-# stdint.m4 serial 19
+# stdint.m4 serial 18
 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -32,14 +32,10 @@ AC_DEFUN([gl_STDINT_H],
   dnl Check for <inttypes.h>.
   dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
   if test $ac_cv_header_inttypes_h = yes; then
-    gl_ABSOLUTE_HEADER([inttypes.h])
-    ABSOLUTE_INTTYPES_H=\"$gl_cv_absolute_inttypes_h\"
     HAVE_INTTYPES_H=1
   else
-    ABSOLUTE_INTTYPES_H=\"no/such/file/inttypes.h\"
     HAVE_INTTYPES_H=0
   fi
-  AC_SUBST([ABSOLUTE_INTTYPES_H])
   AC_SUBST([HAVE_INTTYPES_H])
 
   dnl Check for <sys/types.h>.
index 657953b..73921cb 100644 (file)
@@ -29,7 +29,6 @@ stdint.h: stdint_.h
            -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \
            -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
            -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-           -e 's|@''ABSOLUTE_INTTYPES_H''@|$(ABSOLUTE_INTTYPES_H)|g' \
            -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
            -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
            -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \