Make CppAsString2() more visible in c.h.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Mar 2017 23:54:45 +0000 (18:54 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Mar 2017 00:19:25 +0000 (19:19 -0500)
For some reason this standard C string-processing hack was buried in an
NLS-related section of c.h.  Put it beside CppAsString() so that people
are more likely to find it and not be tempted to reinvent local copies,
as I nearly did.  And provide a more helpful comment, too.

src/include/c.h

index 947bd980672230fb48600edc98932d8720a249b3..bd122f6a56b7bd5061d44c7a048545f9678cb1ba 100644 (file)
 /*
  * CppAsString
  *     Convert the argument to a string, using the C preprocessor.
+ * CppAsString2
+ *     Convert the argument to a string, after one round of macro expansion.
  * CppConcat
  *     Concatenate two arguments together, using the C preprocessor.
  *
  * backward compatibility with existing PostgreSQL code.
  */
 #define CppAsString(identifier) #identifier
+#define CppAsString2(x)            CppAsString(x)
 #define CppConcat(x, y)            x##y
 
 /*
@@ -1002,10 +1005,6 @@ typedef NameData *Name;
  *
  * Make sure this matches the installation rules in nls-global.mk.
  */
-
-/* need a second indirection because we want to stringize the macro value, not the name */
-#define CppAsString2(x) CppAsString(x)
-
 #ifdef SO_MAJOR_VERSION
 #define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION)
 #else