]> granicus.if.org Git - postgresql/commitdiff
Make configure probe for mbstowcs_l as well as wcstombs_l.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 31 Aug 2012 18:18:08 +0000 (14:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 31 Aug 2012 18:18:08 +0000 (14:18 -0400)
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.

configure
configure.in
src/backend/utils/adt/pg_locale.c
src/include/pg_config.h.in
src/include/pg_config.h.win32

index bd1c4cb8726f460d055f7ddaba8bad97aaa877d6..48ff56a60998920cb2ba566134d431f4b4356759 100755 (executable)
--- a/configure
+++ b/configure
@@ -18942,7 +18942,8 @@ fi
 
 
 
-for ac_func in cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l
+
+for ac_func in cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
index 696533e99fcccd4b6b0ed00e5cd9a6bf5a8ff4d9..a4ebd3f9dc7b67c7e5eff2e71adfe60abe70de6d 100644 (file)
@@ -1193,7 +1193,7 @@ PGAC_VAR_INT_TIMEZONE
 AC_FUNC_ACCEPT_ARGTYPES
 PGAC_FUNC_GETTIMEOFDAY_1ARG
 
-AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l])
+AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l])
 
 AC_REPLACE_FUNCS(fseeko)
 case $host_os in
index 401440afae6f1d55d77c63e874fe22f7cc453be0..c3181be0d2f5d20dddd649fe4d35214428c3ccd6 100644 (file)
@@ -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");
index 7cda05c61ec6c294f4e42d882395da7656178f43..f901f82676b7135e3c151dae90b96fff552d1fe8 100644 (file)
 /* Define to 1 if `long long int' works and is 64 bits. */
 #undef HAVE_LONG_LONG_INT_64
 
+/* Define to 1 if you have the `mbstowcs_l' function. */
+#undef HAVE_MBSTOWCS_L
+
 /* Define to 1 if you have the `memmove' function. */
 #undef HAVE_MEMMOVE
 
index a71d59a0fbd04dd849cdf55f8daced4799f92a22..9ad2c7780fb2e6270d68b523a75e1c9bd2e1f22f 100644 (file)
 #define HAVE_LONG_LONG_INT_64
 #endif
 
+/* Define to 1 if you have the `mbstowcs_l' function. */
+#define HAVE_MBSTOWCS_L 1
+
 /* Define to 1 if you have the `memmove' function. */
 #define HAVE_MEMMOVE 1