diff options
author | Olivier Hainque <hainque@adacore.com> | 2019-12-30 22:31:37 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2019-12-30 22:31:37 +0000 |
commit | 1cf49e515c992d4cf4dcbccf0904e8b9e2461820 (patch) | |
tree | c62c39a299f365da2e0d0d83a534fda78569fa34 /gcc/testsuite/gcc.dg/cpp | |
parent | 8ee81b4d275bac80210cc39bb8c93e1f73e1f307 (diff) | |
download | gcc-1cf49e515c992d4cf4dcbccf0904e8b9e2461820.zip gcc-1cf49e515c992d4cf4dcbccf0904e8b9e2461820.tar.gz gcc-1cf49e515c992d4cf4dcbccf0904e8b9e2461820.tar.bz2 |
Prevent redefinition of WCHAR_MAX from testsuite/gcc.dg/cpp/ucs.c
gcc/testsuite/gcc.dg/cpp/ucs.c #include <limits.h>
and then crafts a definition of WCHAR_MAX depending
on __WCHAR_TYPE__.
The test fails in VxWorks configurations because WCHAR_MAX
is already exposed by the system limits.h.
The patch simply guards the tentative definition
by a check verifying if the macro is defined already, so
we're using the value exposed by limits.h in this case.
2019-12-30 Olivier Hainque <hainque@adacore.com>
* testsuite/gcc.dg/cpp/ucs.c: Prevent redefinition
of WCHAR_MAX if already exposed by limits.h.
From-SVN: r279795
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/ucs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/ucs.c b/gcc/testsuite/gcc.dg/cpp/ucs.c index cac83f3..f52cd57 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucs.c +++ b/gcc/testsuite/gcc.dg/cpp/ucs.c @@ -16,6 +16,8 @@ #define short +2 #define long +3 +#if !defined(WCHAR_MAX) + #if __WCHAR_TYPE__ == 0 # define WCHAR_MAX INT_MAX #elif __WCHAR_TYPE__ == 1 @@ -28,6 +30,8 @@ # error wacky wchar_t #endif +#endif + #undef unsigned #undef int #undef char |