Skip to content

Commit 4022f94

Browse files
committed
pg_bind_textdomain_codeset must exist only on ENABLE_NLS.
1 parent fb2ebae commit 4022f94

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/backend/utils/mb/mbutils.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (currently mule internal code (mic) is used)
55
* Tatsuo Ishii
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.80 2009/03/08 16:07:12 alvherre Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.81 2009/03/08 18:10:16 alvherre Exp $
88
*/
99
#include "postgres.h"
1010

@@ -891,17 +891,20 @@ SetDatabaseEncoding(int encoding)
891891
DatabaseEncoding = &pg_enc2name_tbl[encoding];
892892
Assert(DatabaseEncoding->encoding == encoding);
893893

894+
#ifdef ENABLE_NLS
894895
pg_bind_textdomain_codeset(textdomain(NULL), encoding);
896+
#endif
895897
}
896898

897899
/*
898900
* On Windows, we need to explicitly bind gettext to the correct
899901
* encoding, because gettext() tends to get confused.
900902
*/
903+
#ifdef ENABLE_NLS
901904
void
902905
pg_bind_textdomain_codeset(const char *domainname, int encoding)
903906
{
904-
#if defined(ENABLE_NLS) && defined(WIN32)
907+
#ifdef WIN32
905908
int i;
906909

907910
for (i = 0; i < lengthof(codeset_map_array); i++)
@@ -916,6 +919,7 @@ pg_bind_textdomain_codeset(const char *domainname, int encoding)
916919
}
917920
#endif
918921
}
922+
#endif
919923

920924
void
921925
SetDefaultClientEncoding(void)

src/include/mb/pg_wchar.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.85 2009/03/08 16:07:12 alvherre Exp $
9+
* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.86 2009/03/08 18:10:17 alvherre Exp $
1010
*
1111
* NOTES
1212
* This is used both by the backend and by libpq, but should not be
@@ -392,7 +392,9 @@ extern const char *pg_get_client_encoding_name(void);
392392
extern void SetDatabaseEncoding(int encoding);
393393
extern int GetDatabaseEncoding(void);
394394
extern const char *GetDatabaseEncodingName(void);
395+
#ifdef ENABLE_NLS
395396
extern void pg_bind_textdomain_codeset(const char *domainname, int encoding);
397+
#endif
396398

397399
extern int pg_valid_client_encoding(const char *name);
398400
extern int pg_valid_server_encoding(const char *name);

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