From: Bruno Haible Date: Mon, 26 Jun 2006 17:27:53 +0000 (+0000) Subject: Try harder to get WCHAR_MIN and WCHAR_MAX. X-Git-Tag: cvs-readonly~2319 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=b17f732462b975b60c11f8800e413c6dff691e0c;p=gnulib.git Try harder to get WCHAR_MIN and WCHAR_MAX. --- diff --git a/ChangeLog b/ChangeLog index e58645ef6..dccbc8733 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 0602728ec..809b26e1e 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,5 +1,11 @@ 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 in pre-C99 mode. Suggested by Mark D. Baushke and Larry Jones. diff --git a/lib/stdint_.h b/lib/stdint_.h index 73d4f7df5..09e7862eb 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 10f1facaa..05a3739f4 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,5 +1,9 @@ 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 SGI C compiler in pre-C99 mode. Suggested by Mark D. Baushke and Larry Jones. diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 67aea94d5..bbc7e5741 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 e50bb2b76..03dee3416 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' \