diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-12 07:36:02 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-12 07:36:02 +0000 |
commit | 42aaf0b76bb76164db2c67d2df3529dd3c509a97 (patch) | |
tree | 2fb587af1efbd13fd4d86070aee5d3a4a36998c6 /gcc | |
parent | 37d857ac502d15a0ddba759e03c65383a987d343 (diff) | |
download | gcc-42aaf0b76bb76164db2c67d2df3529dd3c509a97.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gengenrtl.c | 6 | ||||
-rw-r--r-- | gcc/protoize.c | 8 | ||||
-rw-r--r-- | gcc/system.h | 18 |
4 files changed, 25 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f14c3e6d880..d225d2e5909 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Tue May 12 10:21:36 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * system.h: Define the STRINGIFY macro here. + * protoize.c: Not here. + * gengenrtl.c (DEF_RTL_EXPR): Use the STRINGIFY macro. + Tue May 12 00:47:33 1998 John Wehle (john@feith.com) * varasm.c (assemble_variable): Compute the alignment of the data diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index b140743b8d7..a631c4ee0df 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -35,11 +35,7 @@ struct rtx_definition const char *enumname, *name, *format; }; -#if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__)) -#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { # ENUM, NAME, FORMAT }, -#else -#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { "ENUM", NAME, FORMAT }, -#endif +#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGIFY(ENUM), NAME, FORMAT }, struct rtx_definition defs[] = { diff --git a/gcc/protoize.c b/gcc/protoize.c index 4b5b13f3a42..e5048c06709 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -201,14 +201,6 @@ extern size_t strlen () #define NONCONST -/* Define a STRINGIFY macro that's right for ANSI or traditional C. */ - -#if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__)) -#define STRINGIFY(STRING) #STRING -#else -#define STRINGIFY(STRING) "STRING" -#endif - /* Define a default place to find the SYSCALLS.X file. */ #ifndef STD_PROTO_DIR diff --git a/gcc/system.h b/gcc/system.h index e1c75abff95..0107b26362e 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__ */ |