aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-08-31 14:18:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-08-31 14:18:08 -0400
commit97395185b85b786523ee41225b53bd84c98d34f4 (patch)
tree39966b6a4370c457fb090c6946bee78e6805bd48 /src/backend/utils
parent6707dd48cdfcc95934a89df5ad4c4c2ecf0e5225 (diff)
downloadpostgresql-97395185b85b786523ee41225b53bd84c98d34f4.tar.gz
postgresql-97395185b85b786523ee41225b53bd84c98d34f4.zip
Make configure probe for mbstowcs_l as well as wcstombs_l.
We previously supposed that any given platform would supply both or neither of these functions, so that one configure test would be sufficient. It now appears that at least on AIX this is not the case ... which is likely an AIX bug, but nonetheless we need to cope with it. So use separate tests. Per bug #6758; thanks to Andrew Hastie for doing the followup testing needed to confirm what was happening. Backpatch to 9.1, where we began using these functions.
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/pg_locale.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 401440afae6..c3181be0d2f 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1191,17 +1191,17 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
else
{
#ifdef HAVE_LOCALE_T
-#ifdef HAVE_WCSTOMBS_L
+#ifdef HAVE_MBSTOWCS_L
/* Use mbstowcs_l for nondefault locales */
result = mbstowcs_l(to, str, tolen, locale);
-#else /* !HAVE_WCSTOMBS_L */
+#else /* !HAVE_MBSTOWCS_L */
/* We have to temporarily set the locale as current ... ugh */
locale_t save_locale = uselocale(locale);
result = mbstowcs(to, str, tolen);
uselocale(save_locale);
-#endif /* HAVE_WCSTOMBS_L */
+#endif /* HAVE_MBSTOWCS_L */
#else /* !HAVE_LOCALE_T */
/* Can't have locale != 0 without HAVE_LOCALE_T */
elog(ERROR, "mbstowcs_l is not available");