diff options
author | Joseph Myers <joseph@codesourcery.com> | 2019-10-03 00:50:58 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2019-10-03 00:50:58 +0100 |
commit | 202be58655a1964581facd2e514c7d3431258fe8 (patch) | |
tree | e811cbd523fca46ee3d3d346249239b8f0daf021 /gcc/ginclude/stdint-gcc.h | |
parent | f5fc32e4a38cee21d1935fd04ad19726f76c06a9 (diff) | |
download | gcc-202be58655a1964581facd2e514c7d3431258fe8.zip gcc-202be58655a1964581facd2e514c7d3431258fe8.tar.gz gcc-202be58655a1964581facd2e514c7d3431258fe8.tar.bz2 |
Define WIDTH macros for C2x.
As part of the integration of TS 18661-1 into C2x, many features
became unconditional features not depending on any feature test macro
being defined. This patch updates the conditionals on the *_WIDTH
macros in limits.h and stdint.h accordingly so that they are defined
for C2x. The macro CR_DECIMAL_DIG in float.h does still require
__STDC_WANT_IEC_60559_BFP_EXT__ to be defined, and a test for this is
added.
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc:
* ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change
condition on WIDTH macros to [__STDC_WANT_IEC_60559_BFP_EXT__ ||
(__STDC_VERSION__ && __STDC_VERSION__ > 201710L)].
* glimits.h: Likewise.
gcc/testsuite:
* gcc.dg/cr-decimal-dig-2.c: New test.
* gcc.dg/limits-width-2.c: New test. Based on limits-width-1.c.
* gcc.dg/stdint-width-2.c: New test. Based on stdint-width-1.c.
From-SVN: r276497
Diffstat (limited to 'gcc/ginclude/stdint-gcc.h')
-rw-r--r-- | gcc/ginclude/stdint-gcc.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ginclude/stdint-gcc.h b/gcc/ginclude/stdint-gcc.h index 83b03b2..e9dc04e 100644 --- a/gcc/ginclude/stdint-gcc.h +++ b/gcc/ginclude/stdint-gcc.h @@ -260,8 +260,9 @@ typedef __UINTMAX_TYPE__ uintmax_t; #endif /* (!defined __cplusplus || __cplusplus >= 201103L || defined __STDC_CONSTANT_MACROS) */ -#ifdef __STDC_WANT_IEC_60559_BFP_EXT__ -/* TS 18661-1 widths of integer types. */ +#if (defined __STDC_WANT_IEC_60559_BFP_EXT__ \ + || (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L)) +/* TS 18661-1 / C2X widths of integer types. */ #ifdef __INT8_TYPE__ # undef INT8_WIDTH |