diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c
index cf6e5d0824f1955d8331a40f2cb1381502fdb105..3a93bbd9a30b12cbfb44a6d2b7dc80c697a9c839 100644
--- a/src/backend/utils/mb/mbutils.c
+++ b/src/backend/utils/mb/mbutils.c
@@ -4,7 +4,7 @@
  * (currently mule internal code (mic) is used)
  * Tatsuo Ishii
  *
- * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.80 2009/03/08 16:07:12 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.81 2009/03/08 18:10:16 alvherre Exp $
  */
 #include "postgres.h"
 
@@ -891,17 +891,20 @@ SetDatabaseEncoding(int encoding)
 	DatabaseEncoding = &pg_enc2name_tbl[encoding];
 	Assert(DatabaseEncoding->encoding == encoding);
 
+#ifdef ENABLE_NLS
 	pg_bind_textdomain_codeset(textdomain(NULL), encoding);
+#endif
 }
 
 /*
  * On Windows, we need to explicitly bind gettext to the correct
  * encoding, because gettext() tends to get confused.
  */
+#ifdef ENABLE_NLS
 void
 pg_bind_textdomain_codeset(const char *domainname, int encoding)
 {
-#if defined(ENABLE_NLS) && defined(WIN32)
+#ifdef WIN32
 	int     i;
 
 	for (i = 0; i < lengthof(codeset_map_array); i++)
@@ -916,6 +919,7 @@ pg_bind_textdomain_codeset(const char *domainname, int encoding)
 	}
 #endif
 }
+#endif
 
 void
 SetDefaultClientEncoding(void)
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 9d37191eabaeb72928c3b3562d3657cd13f28940..37089e2cb0c7c55b19aa634ea0541f692c610e8f 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.85 2009/03/08 16:07:12 alvherre Exp $
+ * $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.86 2009/03/08 18:10:17 alvherre Exp $
  *
  *	NOTES
  *		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);
 extern void SetDatabaseEncoding(int encoding);
 extern int	GetDatabaseEncoding(void);
 extern const char *GetDatabaseEncodingName(void);
+#ifdef ENABLE_NLS
 extern void pg_bind_textdomain_codeset(const char *domainname, int encoding);
+#endif
 
 extern int	pg_valid_client_encoding(const char *name);
 extern int	pg_valid_server_encoding(const char *name);