>From ee1eac82e997ff1b7c8524af74a461b4822c91df Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 18 Nov 2019 22:40:36 +0100 Subject: [PATCH 1/2] 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. --- ChangeLog | 6 ++++++ lib/stdint.in.h | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 048335a..803dcd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 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. * modules/vcs-to-changelog: New file. * MODULES.html.sh (func_all_modules): Add it. diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 733fcb3..e965c4a 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 */ -- 2.7.4