From fe579acee957ae60e72a57bf0f083dd5840f96d6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 28 Aug 2006 20:42:17 +0000 Subject: [PATCH] * 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 , 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 | 4 ++++ lib/ChangeLog | 7 +++++++ lib/inttypes_.h | 15 ++++++++++----- lib/stdint_.h | 4 +++- m4/ChangeLog | 7 +++++++ m4/inttypes.m4 | 11 ++++++++++- m4/stdint.m4 | 6 +----- modules/stdint | 1 - 8 files changed, 42 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6302336c..b66354694 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-08-28 Paul Eggert + * 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. diff --git a/lib/ChangeLog b/lib/ChangeLog index 7454d96d4..b8b8d8b01 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2006-08-28 Paul Eggert + + * 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 , to avoid circular inclusion. + 2006-08-28 Bruno Haible * inttypes_.h (SCNX*): Remove definitions. diff --git a/lib/inttypes_.h b/lib/inttypes_.h index f9ff39a78..96a180695 100644 --- 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 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 @@ * */ -/* Include the original if it exists. */ -#if @HAVE_INTTYPES_H@ -# include @ABSOLUTE_INTTYPES_H@ -#endif /* Include or the gnulib replacement. */ #include /* Get CHAR_BIT. */ diff --git a/lib/stdint_.h b/lib/stdint_.h index 9c0c47d08..1ada94997 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -62,7 +62,9 @@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ -# include @ABSOLUTE_INTTYPES_H@ +# define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H +# include +# undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ diff --git a/m4/ChangeLog b/m4/ChangeLog index 8ddf63ab3..e37b8be00 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2006-08-28 Paul Eggert + + * 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 * inttypes.m4 (gl_INTTYPES_H): Don't test for the existence of SCNX* diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index f2c9eb5ea..d7f021c84 100644 --- 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 @@ 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 . It always defines intptr_t to 'long'. diff --git a/m4/stdint.m4 b/m4/stdint.m4 index b48fb9d37..48748c613 100644 --- 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 @@ AC_DEFUN([gl_STDINT_H], dnl Check for . 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 . diff --git a/modules/stdint b/modules/stdint index 657953b84..73921cb8d 100644 --- a/modules/stdint +++ b/modules/stdint @@ -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' \ -- 2.11.0