Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9739518

Browse files
committed
Make configure probe for mbstowcs_l as well as wcstombs_l.
We previously supposed that any given platform would supply both or neitherof these functions, so that one configure test would be sufficient. It nowappears that at least on AIX this is not the case ... which is likely anAIX bug, but nonetheless we need to cope with it. So use separate tests.Per bug #6758; thanks to Andrew Hastie for doing the followup testingneeded to confirm what was happening.Backpatch to 9.1, where we began using these functions.
1 parent6707dd4 commit9739518

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

‎configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18942,7 +18942,8 @@ fi
1894218942

1894318943

1894418944

18945-
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
18945+
18946+
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
1894618947
do
1894718948
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1894818949
{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5

‎configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ PGAC_VAR_INT_TIMEZONE
11931193
AC_FUNC_ACCEPT_ARGTYPES
11941194
PGAC_FUNC_GETTIMEOFDAY_1ARG
11951195

1196-
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])
1196+
AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimitmbstowcs_lmemmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l])
11971197

11981198
AC_REPLACE_FUNCS(fseeko)
11991199
case $host_os in

‎src/backend/utils/adt/pg_locale.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,17 +1191,17 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
11911191
else
11921192
{
11931193
#ifdefHAVE_LOCALE_T
1194-
#ifdefHAVE_WCSTOMBS_L
1194+
#ifdefHAVE_MBSTOWCS_L
11951195
/* Use mbstowcs_l for nondefault locales */
11961196
result=mbstowcs_l(to,str,tolen,locale);
1197-
#else/* !HAVE_WCSTOMBS_L */
1197+
#else/* !HAVE_MBSTOWCS_L */
11981198
/* We have to temporarily set the locale as current ... ugh */
11991199
locale_tsave_locale=uselocale(locale);
12001200

12011201
result=mbstowcs(to,str,tolen);
12021202

12031203
uselocale(save_locale);
1204-
#endif/*HAVE_WCSTOMBS_L */
1204+
#endif/*HAVE_MBSTOWCS_L */
12051205
#else/* !HAVE_LOCALE_T */
12061206
/* Can't have locale != 0 without HAVE_LOCALE_T */
12071207
elog(ERROR,"mbstowcs_l is not available");

‎src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@
339339
/* Define to 1 if `long long int' works and is 64 bits. */
340340
#undef HAVE_LONG_LONG_INT_64
341341

342+
/* Define to 1 if you have the `mbstowcs_l' function. */
343+
#undef HAVE_MBSTOWCS_L
344+
342345
/* Define to 1 if you have the `memmove' function. */
343346
#undef HAVE_MEMMOVE
344347

‎src/include/pg_config.h.win32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@
249249
#define HAVE_LONG_LONG_INT_64
250250
#endif
251251

252+
/* Define to 1 if you have the `mbstowcs_l' function. */
253+
#define HAVE_MBSTOWCS_L 1
254+
252255
/* Define to 1 if you have the `memmove' function. */
253256
#define HAVE_MEMMOVE 1
254257

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp