From 78e0ba39dcad4d5deb84479ccd108a89f53ea853 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 25 Jan 2001 21:56:21 +0000 Subject: [PATCH] acconfig.h: Define `const' to the empty string if neither __STDC__ nor __cplusplus is defined. * acconfig.h: Define `const' to the empty string if neither __STDC__ nor __cplusplus is defined. * config.in: Regenerated. From-SVN: r39272 --- gcc/ChangeLog | 6 ++++++ gcc/acconfig.h | 14 ++++++++++++++ gcc/config.in | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 22a392a..4a7417f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-01-25 Mark Mitchell + + * acconfig.h: Define `const' to the empty string if neither + __STDC__ nor __cplusplus is defined. + * config.in: Regenerated. + 2001-01-25 David Edelsohn * config.gcc (rs6000-ibm-aix[5-9]*): Change to aix51.h. diff --git a/gcc/acconfig.h b/gcc/acconfig.h index 3e8c595..dec619b 100644 --- a/gcc/acconfig.h +++ b/gcc/acconfig.h @@ -25,3 +25,17 @@ /* Define to `int' if doesn't define. */ #undef ssize_t + +@BOTTOM@ + +/* Bison unconditionally undefines `const' if neither `__STDC__' nor + __cplusplus are defined. That's a problem since we use `const' in + the GCC headers, and the resulting bison code is therefore type + unsafe. Thus, we must match the bison behavior here. */ + +#ifndef __STDC__ +#ifndef __cplusplus +#undef const +#define const +#endif +#endif diff --git a/gcc/config.in b/gcc/config.in index 497820e..a433687 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -452,3 +452,15 @@ /* Define to 1 if you want to enable namespaces (-fhonor-std) by default. */ #undef ENABLE_STD_NAMESPACE + +/* Bison unconditionally undefines `const' if neither `__STDC__' nor + __cplusplus are defined. That's a problem since we use `const' in + the GCC headers, and the resulting bison code is therefore type + unsafe. Thus, we must match the bison behavior here. */ + +#ifndef __STDC__ +#ifndef __cplusplus +#undef const +#define const +#endif +#endif -- 2.7.4