Commit 1cf49e51 by Olivier Hainque Committed by Olivier Hainque

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
parent 8ee81b4d
2019-12-20 Olivier Hainque <hainque@adacore.com>
* testsuite/gcc.dg/cpp/ucs.c: Prevent redefinition
of WCHAR_MAX if already exposed by limits.h.
2019-12-20 Olivier Hainque <hainque@adacore.com>
Jerome Lambourg <lambourg@adacore.com>
* c-c++-common/pr56493.c: Allow '$' in addition to '.'
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment