* system.h: Define the STRINGIFY macro here.
* protoize.c: Not here.
* gengenrtl.c (DEF_RTL_EXPR): Use the STRINGIFY macro.
From-SVN: r19696
+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
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[] =
{
#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
#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__ */