From: Gurusamy Sarathy Date: Sat, 4 Mar 2000 19:42:55 +0000 (+0000) Subject: make CAT2() portable for use as a macro argument with an extra X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0519643027383a891fd684df8a90fa5b75bf419;p=p5sagit%2Fp5-mst-13.2.git make CAT2() portable for use as a macro argument with an extra level of macros p4raw-id: //depot/perl@5525 --- diff --git a/config_h.SH b/config_h.SH index d452aa9..40b5b84 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1204,15 +1204,19 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This macro surrounds its token with double quotes. */ #if $cpp_stuff == 1 -#define CAT2(a,b)a/**/b -#define STRINGIFY(a)"a" +# define CAT2(a,b) a/**/b +# define STRINGIFY(a) "a" /* If you can get stringification with catify, tell me how! */ #endif #if $cpp_stuff == 42 -#define CAT2(a,b)a ## b -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) +# define PeRl_CaTiFy(a,b) a ## b +# define PeRl_StGiFy(a) #a + /* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +# define CAT2(a,b) PeRl_CaTiFy(a,b) +# define STRINGIFY(a) PeRl_StGiFy(a) #endif + #if $cpp_stuff != 1 && $cpp_stuff != 42 #include "Bletch: How does this C preprocessor catenate tokens?" #endif