summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/c.h28
-rw-r--r--src/include/miscadmin.h4
-rw-r--r--src/include/pg_config.h.in3
3 files changed, 32 insertions, 3 deletions
diff --git a/src/include/c.h b/src/include/c.h
index ca86067b9f9..4493fb91037 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 3a3f3830991..821f8647363 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 9f6f21bf817..5ba3ca82604 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