diff options
| author | Paul Eggert | 2016-04-11 09:02:00 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-11 09:03:22 -0700 |
| commit | b134c206bc07dbbb9e74b3be2db269c4f1196e40 (patch) | |
| tree | 1e6633483030e7fca0dc19ac0a63efe420f58e8d /lib | |
| parent | bb30fa951c23911f5c3a14d9d46d1a3260a50fe0 (diff) | |
| download | emacs-b134c206bc07dbbb9e74b3be2db269c4f1196e40.tar.gz emacs-b134c206bc07dbbb9e74b3be2db269c4f1196e40.zip | |
Sync with gnulib
This is for picky compilers whose stdint.h fails our C11 tests.
Problem reported for clang by Philipp Stephani (Bug#23261).
This incorporates:
2016-04-11 stdint: port to strict C11 left shift
* doc/misc/texinfo.tex, lib/stdint.in.h: Copy from gnulib.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/stdint.in.h | 9 |
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 | ||