aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/stdint.in.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 0bb9ad41b29..cf65ec62e97 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -118,15 +118,10 @@
118 picky compilers. */ 118 picky compilers. */
119 119
120#define _STDINT_MIN(signed, bits, zero) \ 120#define _STDINT_MIN(signed, bits, zero) \
121 ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) 121 ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
122 122
123#define _STDINT_MAX(signed, bits, zero) \ 123#define _STDINT_MAX(signed, bits, zero) \
124 ((signed) \ 124 (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
125 ? ~ _STDINT_MIN (signed, bits, zero) \
126 : /* The expression for the unsigned case. The subtraction of (signed) \
127 is a nop in the unsigned case and avoids "signed integer overflow" \
128 warnings in the signed case. */ \
129 ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
130 125
131#if !GNULIB_defined_stdint_types 126#if !GNULIB_defined_stdint_types
132 127