summaryrefslogtreecommitdiff
path: root/config_h.SH
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-04 19:42:55 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-04 19:42:55 +0000
commitd0519643027383a891fd684df8a90fa5b75bf419 (patch)
tree58dbc93e63c4b22e9c048950f600524d6df3f675 /config_h.SH
parent6af84f9fb71a3207be80bf9d2f1ad85d0d98bd09 (diff)
downloadperl-d0519643027383a891fd684df8a90fa5b75bf419.tar.gz
make CAT2() portable for use as a macro argument with an extra
level of macros p4raw-id: //depot/perl@5525
Diffstat (limited to 'config_h.SH')
-rw-r--r--config_h.SH14
1 files changed, 9 insertions, 5 deletions
diff --git a/config_h.SH b/config_h.SH
index d452aa9fa1..40b5b84413 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -1204,15 +1204,19 @@ sed <<!GROK!THIS! >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