# HG changeset patch # User Bruno Haible # Date 1298099334 28800 # Node ID 8c612d3fafe74f0388a54642f5b678fcdcf0e786 # Parent 4da22ca0951d9f3e3517253b77fa38292fb523b9 stdint: Cut dependency to module 'wchar'. * lib/stdint.in.h: Include wchar.h only when HAVE_WCHAR_H is 1. Also include the necessary prerequisites. * m4/stdint.m4 (gl_STDINT_H): Test whether wchar.h exists. * modules/stdint (Depends-on): Remove wchar. (Makefile.am): Substitute HAVE_WCHAR_H. This reverts part of a 2007-01-06 commit. Reported by Paul Eggert. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-02-18 Bruno Haible + + stdint: Cut dependency to module 'wchar'. + * lib/stdint.in.h: Include wchar.h only when HAVE_WCHAR_H is 1. Also + include the necessary prerequisites. + * m4/stdint.m4 (gl_STDINT_H): Test whether wchar.h exists. + * modules/stdint (Depends-on): Remove wchar. + (Makefile.am): Substitute HAVE_WCHAR_H. + This reverts part of a 2007-01-06 commit. Reported by Paul Eggert. + 2011-02-18 Eric Blake longlong: skip, rather than fail, on cross-compilation diff --git a/lib/stdint.in.h b/lib/stdint.in.h --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -497,7 +497,12 @@ sequence of nested includes -> -> -> , and the latter includes and assumes its types are already defined. */ -#if ! (defined WCHAR_MIN && defined WCHAR_MAX) +#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ +# include +# include +# include # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H diff --git a/m4/stdint.m4 b/m4/stdint.m4 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 37 +# stdint.m4 serial 38 dnl Copyright (C) 2001-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -27,6 +27,15 @@ fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + dnl Check for , in the same way as gl_WCHAR_H does. + AC_CHECK_HEADERS_ONCE([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then diff --git a/modules/stdint b/modules/stdint --- a/modules/stdint +++ b/modules/stdint @@ -14,7 +14,6 @@ Depends-on: include_next multiarch -wchar configure.ac: gl_STDINT_H @@ -36,6 +35,7 @@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_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_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \