changeset 9135:5a648774d6a3

Don't pretend that stdint.h conforms to C99 if it doesn't define WCHAR_MIN and WCHAR_MAX.
author Bruno Haible <bruno@clisp.org>
date Tue, 31 Jul 2007 22:34:58 +0000
parents 38df3bd8e54e
children 749d702b319d
files ChangeLog m4/stdint.m4
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-31  Bruno Haible  <bruno@clisp.org>
+
+	* m4/stdint.m4 (gl_STDINT_H): Test whether WCHAR_MIN and WCHAR_MAX
+	are defined by <stdint.h> (as opposed to <wchar.h>, as on Dragonfly).
+	Reported by Joerg Sonnenberger <joerg@britannica.bec.de>.
+
 2007-07-31  Bruno Haible  <bruno@clisp.org>
 
 	* lib/fflush.c (rpl_fflush): On BSD systems, use the __SNPT flag.
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 27
+# stdint.m4 serial 28
 dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -59,12 +59,18 @@
       [gl_cv_header_working_stdint_h],
       [gl_cv_header_working_stdint_h=no
        AC_COMPILE_IFELSE([
-         AC_LANG_PROGRAM([gl_STDINT_INCLUDES
-         [
+         AC_LANG_PROGRAM([[
 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
 #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
+]
+gl_STDINT_INCLUDES
+[
 #ifdef INT8_MAX
 int8_t a1 = INT8_MAX;
 int8_t a1min = INT8_MIN;