22/* -----------------------------------------------------------------------
33 * pg_locale.c
44 *
5- * $Header: /cvsroot/pgsql/src/backend/utils/adt/pg_locale.c,v 1.4 2000/04/12 17:15:51 momjian Exp $
5+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/pg_locale.c,v 1.5 2000/06/29 01:19:36 momjian Exp $
66 *
77 *
88 * Portions Copyright (c) 1999-2000, PostgreSQL, Inc
@@ -40,8 +40,9 @@ PGLC_current(PG_LocaleCategories * lc)
4040lc -> lc_time = setlocale (LC_TIME ,NULL );
4141lc -> lc_collate = setlocale (LC_COLLATE ,NULL );
4242lc -> lc_monetary = setlocale (LC_MONETARY ,NULL );
43+ #ifdef LC_MESSAGES
4344lc -> lc_messages = setlocale (LC_MESSAGES ,NULL );
44-
45+ #endif
4546return lc ;
4647}
4748
@@ -55,14 +56,20 @@ PGLC_current(PG_LocaleCategories * lc)
5556PG_LocaleCategories *
5657PGLC_debug_lc (PG_LocaleCategories * lc )
5758{
59+ #ifdef LC_MESSAGES
5860elog (DEBUG ,"CURRENT LOCALE ENVIRONMENT:\n\nLANG: \t%s\nLC_CTYPE:\t%s\nLC_NUMERIC:\t%s\nLC_TIME:\t%s\nLC_COLLATE:\t%s\nLC_MONETARY:\t%s\nLC_MESSAGES:\t%s\n" ,
61+ #else
62+ elog (DEBUG ,"CURRENT LOCALE ENVIRONMENT:\n\nLANG: \t%s\nLC_CTYPE:\t%s\nLC_NUMERIC:\t%s\nLC_TIME:\t%s\nLC_COLLATE:\t%s\nLC_MONETARY:\t%s\n" ,
63+ #endif
5964lc -> lang ,
6065lc -> lc_ctype ,
6166lc -> lc_numeric ,
6267lc -> lc_time ,
6368lc -> lc_collate ,
64- lc -> lc_monetary ,
65- lc -> lc_messages
69+ lc -> lc_monetary
70+ #ifdef LC_MESSAGES
71+ ,lc -> lc_messages
72+ #endif
6673);
6774
6875return lc ;
@@ -91,10 +98,10 @@ PGLC_setlocale(PG_LocaleCategories * lc)
9198
9299if (!setlocale (LC_MONETARY ,lc -> lc_monetary ))
93100elog (NOTICE ,"pg_setlocale(): 'LC_MONETARY=%s' cannot be honored." ,lc -> lc_monetary );
94-
101+ #ifdef LC_MESSAGES
95102if (!setlocale (LC_MESSAGES ,lc -> lc_messages ))
96103elog (NOTICE ,"pg_setlocale(): 'LC_MESSAGE=%s' cannot be honored." ,lc -> lc_messages );
97-
104+ #endif
98105return lc ;
99106}
100107