From: Bruno Haible Date: Mon, 18 Nov 2019 21:40:36 +0000 (+0100) Subject: stdint: Fix value of WINT_MAX when we override wint_t. X-Git-Tag: v1.0~4594 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee1eac82e997ff1b7c8524af74a461b4822c91df;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 048335a8fb..803dcd1a1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-11-18 Bruno Haible + + 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 vcs-to-changelog: New module. diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 733fcb398c..e965c4a6cc 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -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 or 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 */