From b17f732462b975b60c11f8800e413c6dff691e0c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 26 Jun 2006 17:27:53 +0000 Subject: [PATCH] Try harder to get WCHAR_MIN and WCHAR_MAX. --- ChangeLog | 4 ++++ lib/ChangeLog | 6 ++++++ lib/stdint_.h | 5 +++++ m4/ChangeLog | 4 ++++ m4/stdint.m4 | 11 ++++++++++- modules/stdint | 3 ++- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e58645ef66..dccbc8733b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-06-26 Bruno Haible + + * modules/stdint (Makefile.am): Also substitute HAVE_WCHAR_H. + 2006-06-23 Simon Josefsson Bruno Haible diff --git a/lib/ChangeLog b/lib/ChangeLog index 0602728ec4..809b26e1e5 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2006-06-26 Bruno Haible + + * stdlib_.h: Include if necessary for WCHAR_MIN or + WCHAR_MAX. + Reported by Mark D. Baushke and Larry Jones. + 2006-06-26 Bruno Haible * stdlib_.h: Don't include when using the SGI C compiler diff --git a/lib/stdint_.h b/lib/stdint_.h index 73d4f7df53..09e7862ebf 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -26,6 +26,11 @@ /* Get wchar_t, WCHAR_MIN, WCHAR_MAX. */ #include +/* Some systems define WCHAR_MIN, WCHAR_MAX in , not . */ +#if !(defined(WCHAR_MIN) && defined(WCHAR_MAX)) && @HAVE_WCHAR_H@ +# include +#endif + /* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ #include diff --git a/m4/ChangeLog b/m4/ChangeLog index 10f1facaa4..05a3739f4b 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,7 @@ +2006-06-26 Bruno Haible + + * stdint.m4 (gl_STDINT_H): Test also for . + 2006-06-26 Bruno Haible * stdint.m4 (gl_STDINT_H): Don't include when using the diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 67aea94d5d..bbc7e5741a 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -9,6 +9,15 @@ dnl Test whether is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ + dnl Check for . + 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 that doesn't clash with . gl_HEADER_STDINT_H if test $gl_cv_header_stdint_h = yes; then @@ -279,7 +288,7 @@ msvc compiler gl_STDINT_MISSING_BOUNDS2([SIG_ATOMIC_MIN SIG_ATOMIC_MAX], [#include ]) dnl Don't bother defining WCHAR_MIN and WCHAR_MAX, since they should - dnl already be defined in . + dnl already be defined in or . dnl For wint_t we need . dnl Tru64 with Desktop Toolkit C has a bug: must be included dnl before . diff --git a/modules/stdint b/modules/stdint index e50bb2b761..03dee34163 100644 --- a/modules/stdint +++ b/modules/stdint @@ -22,7 +22,8 @@ EXTRA_DIST += stdint_.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint_.h - sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''FULL_PATH_STDINT_H''@|$(FULL_PATH_STDINT_H)|g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's|@''FULL_PATH_INTTYPES_H''@|$(FULL_PATH_INTTYPES_H)|g' \ -- 2.30.2