changeset 7223:dabe23a32d21

* lib/inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]: 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.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 28 Aug 2006 20:42:17 +0000
parents 06eec4eaf416
children c42a57e8d187
files ChangeLog lib/ChangeLog lib/inttypes_.h lib/stdint_.h m4/ChangeLog m4/inttypes.m4 m4/stdint.m4 modules/stdint
diffstat 8 files changed, 42 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -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.
--- a/lib/inttypes_.h
+++ b/lib/inttypes_.h
@@ -16,7 +16,16 @@
    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
 
 /*
@@ -24,10 +33,6 @@
  * <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.  */
--- a/lib/stdint_.h
+++ b/lib/stdint_.h
@@ -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.  */
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -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*
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -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 @@
     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'.
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -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 @@
   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>.
--- a/modules/stdint
+++ b/modules/stdint
@@ -29,7 +29,6 @@
 	    -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' \