diff options
| author | Peter Eisentraut | 2008-12-11 07:34:09 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2008-12-11 07:34:09 +0000 |
| commit | 218b4e8dd86016f82c3a71dec9d339240e866505 (patch) | |
| tree | 1406076a9d31827ee9de1b04e16f4637d3fc186e /src/include | |
| parent | 55368223cde4f19b4cd97eff7ea82b4a85a7a04c (diff) | |
Append major version number and for libraries soname major version number
to the gettext domain name, to simplify parallel installations.
Also, rename set_text_domain() to pg_bindtextdomain(), because that is what
it does.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/c.h | 28 | ||||
| -rw-r--r-- | src/include/miscadmin.h | 4 | ||||
| -rw-r--r-- | src/include/pg_config.h.in | 3 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/include/c.h b/src/include/c.h index ca86067b9f..4493fb9103 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/c.h,v 1.230 2008/10/09 22:23:46 tgl Exp $ + * $PostgreSQL: pgsql/src/include/c.h,v 1.231 2008/12/11 07:34:08 petere Exp $ * *------------------------------------------------------------------------- */ @@ -715,6 +715,32 @@ typedef NameData *Name; #define STATUS_WAITING (2) +/* gettext domain name mangling */ + +/* + * To better support parallel installations of major PostgeSQL + * versions as well as parallel installations of major library soname + * versions, we mangle the gettext domain name by appending those + * version numbers. The coding rule ought to be that whereever the + * domain name is mentioned as a literal, it must be wrapped into + * PG_TEXTDOMAIN(). The macros below do not work on non-literals; but + * that is somewhat intentional because it avoids having to worry + * about multiple states of premangling and postmangling as the values + * are being passed around. + * + * 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 +# define PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION) +#endif + + /* ---------------------------------------------------------------- * Section 8: system-specific hacks * diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 3a3f383099..821f864736 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.205 2008/11/11 02:42:32 tgl Exp $ + * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.206 2008/12/11 07:34:08 petere Exp $ * * NOTES * some of the information in this file should be moved to other files. @@ -343,7 +343,7 @@ extern void RecordSharedMemoryInLockFile(unsigned long id1, extern void ValidatePgVersion(const char *path); extern void process_shared_preload_libraries(void); extern void process_local_preload_libraries(void); -extern void set_text_domain(const char *domain); +extern void pg_bindtextdomain(const char *domain); /* in access/transam/xlog.c */ extern bool BackupInProgress(void); diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 9f6f21bf81..5ba3ca8260 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -642,6 +642,9 @@ (--with-krb-srvnam=NAME) */ #undef PG_KRB_SRVNAM +/* PostgreSQL major version as a string */ +#undef PG_MAJORVERSION + /* PostgreSQL version as a string */ #undef PG_VERSION |
