Skip to content

Commit 932d1e5

Browse files
committed
Add #ifdef for LC_MESSAGES, because it is not ANSI C standard, and BSDI
does not have it.
1 parent 44f64dd commit 932d1e5

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/backend/utils/adt/pg_locale.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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)
4040
lc->lc_time = setlocale(LC_TIME, NULL);
4141
lc->lc_collate = setlocale(LC_COLLATE, NULL);
4242
lc->lc_monetary = setlocale(LC_MONETARY, NULL);
43+
#ifdef LC_MESSAGES
4344
lc->lc_messages = setlocale(LC_MESSAGES, NULL);
44-
45+
#endif
4546
return lc;
4647
}
4748

@@ -55,14 +56,20 @@ PGLC_current(PG_LocaleCategories * lc)
5556
PG_LocaleCategories *
5657
PGLC_debug_lc(PG_LocaleCategories * lc)
5758
{
59+
#ifdef LC_MESSAGES
5860
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\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
5964
lc->lang,
6065
lc->lc_ctype,
6166
lc->lc_numeric,
6267
lc->lc_time,
6368
lc->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

6875
return lc;
@@ -91,10 +98,10 @@ PGLC_setlocale(PG_LocaleCategories * lc)
9198

9299
if (!setlocale(LC_MONETARY, lc->lc_monetary))
93100
elog(NOTICE, "pg_setlocale(): 'LC_MONETARY=%s' cannot be honored.", lc->lc_monetary);
94-
101+
#ifdef LC_MESSAGES
95102
if (!setlocale(LC_MESSAGES, lc->lc_messages))
96103
elog(NOTICE, "pg_setlocale(): 'LC_MESSAGE=%s' cannot be honored.", lc->lc_messages);
97-
104+
#endif
98105
return lc;
99106
}
100107

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