]> Savannah Git Hosting - gnulib.git/commitdiff
stdint: Fix value of WINT_MAX when we override wint_t.
authorBruno Haible <bruno@clisp.org>
Mon, 18 Nov 2019 21:40:36 +0000 (22:40 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 18 Nov 2019 21:41:02 +0000 (22:41 +0100)
* lib/stdint.in.h (WINT_MIN, WINT_MAX): Don't override a second time
when GNULIB_OVERRIDES_WINT_T is 1.

ChangeLog
lib/stdint.in.h

index 048335a8fb84328c877f2a40e67be423ce8d6656..803dcd1a1cb5223aeecb8b0c08347eaeee3089db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-18  Bruno Haible  <bruno@clisp.org>
+
+       stdint: Fix value of WINT_MAX when we override wint_t.
+       * lib/stdint.in.h (WINT_MIN, WINT_MAX): Don't override a second time
+       when GNULIB_OVERRIDES_WINT_T is 1.
+
 2019-11-18  Bruno Haible  <bruno@clisp.org>
 
        vcs-to-changelog: New module.
index 733fcb398c8c1cb02eb871598978e5db35dad94f..e965c4a6cc76249afe4ee2571e77cf4e6becdb4c 100644 (file)
@@ -591,17 +591,21 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
 
 /* wint_t limits */
-# undef WINT_MIN
-# undef WINT_MAX
-# if @HAVE_SIGNED_WINT_T@
-#  define WINT_MIN  \
-    _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
-# else
-#  define WINT_MIN  \
-    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+/* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not
+   accurate, therefore use the definitions from above.  */
+# if !@GNULIB_OVERRIDES_WINT_T@
+#  undef WINT_MIN
+#  undef WINT_MAX
+#  if @HAVE_SIGNED_WINT_T@
+#   define WINT_MIN  \
+     _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#  else
+#   define WINT_MIN  \
+     _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#  endif
+#  define WINT_MAX  \
+    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
 # endif
-# define WINT_MAX  \
-   _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
 
 /* 7.18.4. Macros for integer constants */