diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1999-03-07 05:21:41 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1999-03-07 05:21:41 +0000 |
commit | 366453bf4b050c61e1f3fc3a663264466dcb251d (patch) | |
tree | efe3d1eb875964faf4d81b429208086fe8886d6d /gcc | |
parent | b26caacda9dc52ede6cfc5ceb70419a6e4d9c905 (diff) | |
download | gcc-366453bf4b050c61e1f3fc3a663264466dcb251d.zip gcc-366453bf4b050c61e1f3fc3a663264466dcb251d.tar.gz gcc-366453bf4b050c61e1f3fc3a663264466dcb251d.tar.bz2 |
system.h (const, inline): Move the stage2 handling of these keywords-as-macros from here...
* system.h (const, inline): Move the stage2 handling of these
keywords-as-macros from here...
* gansidecl.h (const, inline): ...to here.
(This became necessary after using `const' in config directory headers,
which get included before system.h does. If we're going to reset these
keywords, we must do so before absolutely any other header file.)
From-SVN: r25626
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/gansidecl.h | 13 | ||||
-rw-r--r-- | gcc/system.h | 12 |
3 files changed, 20 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b7bb5a..0675c03 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Sun Mar 7 08:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * system.h (const, inline): Move the stage2 handling of these + keywords-as-macros from here... + + * gansidecl.h (const, inline): ...to here. + Sun Mar 7 02:44:15 1999 Richard Henderson <rth@cygnus.com> * recog.c (push_operand, pop_operand): VOIDmode needn't match modes. diff --git a/gcc/gansidecl.h b/gcc/gansidecl.h index 5929f15..cf7762f 100644 --- a/gcc/gansidecl.h +++ b/gcc/gansidecl.h @@ -34,6 +34,19 @@ Boston, MA 02111-1307, USA. */ #define VPROTO(ARGS) VPARAMS(ARGS) #define PVPROTO(ARGS) PARAMS(ARGS) +/* Autoconf will possibly define the `inline' or `const' keywords as + macros, however this is only valid for the stage1 compiler. If we + detect a modern version of gcc, unconditionally reset the values. + This makes sure the right thing happens in stage2 and later. We + need to do this very early; i.e. before any systems header files or + gcc header files in case they use these keywords. Otherwise + conflicts might occur. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# undef const +# undef inline +# define inline __inline__ /* Modern gcc can use `__inline__' freely. */ +#endif /* GCC >= 2.7 */ + #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __attribute__(x) #endif diff --git a/gcc/system.h b/gcc/system.h index 6e549ca..e668a9e 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -22,18 +22,6 @@ Boston, MA 02111-1307, USA. */ #ifndef __GCC_SYSTEM_H__ #define __GCC_SYSTEM_H__ -/* Autoconf will possibly define the `inline' or `const' keywords as - macros, however this is only valid for the stage1 compiler. If we - detect a modern version of gcc, unconditionally reset the values. - This makes sure the right thing happens in stage2 and later. We - need to do this before any header files in case they use these - keywords or conflicts might occur. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# undef const -# undef inline -# define inline __inline__ /* Modern gcc can use `__inline__' freely. */ -#endif /* GCC >= 2.7 */ - /* We must include stdarg.h/varargs.h before stdio.h. */ #ifdef ANSI_PROTOTYPES #include <stdarg.h> |