Skip to content

Commit 9cfc4de

Browse files
committed
Make CppAsString2() more visible in c.h.
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.
1 parent 7666e73 commit 9cfc4de

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/include/c.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@
149149
/*
150150
* CppAsString
151151
* Convert the argument to a string, using the C preprocessor.
152+
* CppAsString2
153+
* Convert the argument to a string, after one round of macro expansion.
152154
* CppConcat
153155
* Concatenate two arguments together, using the C preprocessor.
154156
*
@@ -157,6 +159,7 @@
157159
* backward compatibility with existing PostgreSQL code.
158160
*/
159161
#define CppAsString(identifier) #identifier
162+
#define CppAsString2(x) CppAsString(x)
160163
#define CppConcat(x, y) x##y
161164

162165
/*
@@ -1002,10 +1005,6 @@ typedef NameData *Name;
10021005
*
10031006
* Make sure this matches the installation rules in nls-global.mk.
10041007
*/
1005-
1006-
/* need a second indirection because we want to stringize the macro value, not the name */
1007-
#define CppAsString2(x) CppAsString(x)
1008-
10091008
#ifdef SO_MAJOR_VERSION
10101009
#define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION)
10111010
#else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy