diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1998-05-12 07:36:02 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1998-05-12 07:36:02 +0000 |
commit | d4ba0ead26158841f25581b7fadeab674518f828 (patch) | |
tree | 2fb587af1efbd13fd4d86070aee5d3a4a36998c6 /gcc/system.h | |
parent | 7bc6a9ffaa55bd7593fe04984a46e2dc8f7175b5 (diff) | |
download | gcc-d4ba0ead26158841f25581b7fadeab674518f828.zip gcc-d4ba0ead26158841f25581b7fadeab674518f828.tar.gz gcc-d4ba0ead26158841f25581b7fadeab674518f828.tar.bz2 |
Consolidate support for "String-ification" into system.h:
* system.h: Define the STRINGIFY macro here.
* protoize.c: Not here.
* gengenrtl.c (DEF_RTL_EXPR): Use the STRINGIFY macro.
From-SVN: r19696
Diffstat (limited to 'gcc/system.h')
-rw-r--r-- | gcc/system.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h index e1c75ab..0107b26 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -249,4 +249,22 @@ void abort (); #endif /* USE_SYSTEM_ABORT */ #endif /* !abort */ + +/* Define a STRINGIFY macro that's right for ANSI or traditional C. + HAVE_CPP_STRINGIFY only refers to the stage1 compiler. Assume that + (non-traditional) gcc used in stage2 or later has this feature. + + Note: if the argument passed to STRINGIFY is itself a macro, eg + #define foo bar, STRINGIFY(foo) will produce "foo", not "bar". + Although the __STDC__ case could be made to expand this via a layer + of indirection, the traditional C case can not do so. Therefore + this behavior is not supported. */ +#ifndef STRINGIFY +# if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__)) +# define STRINGIFY(STRING) #STRING +# else +# define STRINGIFY(STRING) "STRING" +# endif +#endif /* ! STRINGIFY */ + #endif /* __GCC_SYSTEM_H__ */ |