summaryrefslogtreecommitdiffstats
path: root/gl/m4/mbrtowc.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/mbrtowc.m4')
-rw-r--r--gl/m4/mbrtowc.m437
1 files changed, 19 insertions, 18 deletions
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index 62c4fdb3..cc09a5fb 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,10 +1,11 @@
1# mbrtowc.m4 1# mbrtowc.m4
2# serial 44 -*- coding: utf-8 -*- 2# serial 46
3dnl Copyright (C) 2001-2002, 2004-2005, 2008-2024 Free Software Foundation, 3dnl Copyright (C) 2001-2002, 2004-2005, 2008-2025 Free Software Foundation,
4dnl Inc. 4dnl Inc.
5dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved. 7dnl with or without modifications, as long as this notice is preserved.
8dnl This file is offered as-is, without any warranty.
8 9
9AC_DEFUN([gl_FUNC_MBRTOWC], 10AC_DEFUN([gl_FUNC_MBRTOWC],
10[ 11[
@@ -160,7 +161,7 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
160[ 161[
161 AC_REQUIRE([AC_PROG_CC]) 162 AC_REQUIRE([AC_PROG_CC])
162 AC_REQUIRE([gt_LOCALE_JA]) 163 AC_REQUIRE([gt_LOCALE_JA])
163 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 164 AC_REQUIRE([gt_LOCALE_EN_UTF8])
164 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 165 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
165 AC_CACHE_CHECK([whether mbrtowc handles incomplete characters], 166 AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
166 [gl_cv_func_mbrtowc_incomplete_state], 167 [gl_cv_func_mbrtowc_incomplete_state],
@@ -200,7 +201,7 @@ int main ()
200 [gl_cv_func_mbrtowc_incomplete_state=no], 201 [gl_cv_func_mbrtowc_incomplete_state=no],
201 [:]) 202 [:])
202 else 203 else
203 if test $LOCALE_FR_UTF8 != none; then 204 if test "$LOCALE_EN_UTF8" != none; then
204 AC_RUN_IFELSE( 205 AC_RUN_IFELSE(
205 [AC_LANG_SOURCE([[ 206 [AC_LANG_SOURCE([[
206#include <locale.h> 207#include <locale.h>
@@ -208,7 +209,7 @@ int main ()
208#include <wchar.h> 209#include <wchar.h>
209int main () 210int main ()
210{ 211{
211 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 212 if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
212 { 213 {
213 const char input[] = "B\303\274\303\237er"; /* "Büßer" */ 214 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
214 mbstate_t state; 215 mbstate_t state;
@@ -288,7 +289,7 @@ dnl Result is gl_cv_func_mbrtowc_null_arg1.
288AC_DEFUN([gl_MBRTOWC_NULL_ARG1], 289AC_DEFUN([gl_MBRTOWC_NULL_ARG1],
289[ 290[
290 AC_REQUIRE([AC_PROG_CC]) 291 AC_REQUIRE([AC_PROG_CC])
291 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 292 AC_REQUIRE([gt_LOCALE_EN_UTF8])
292 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 293 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
293 AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], 294 AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument],
294 [gl_cv_func_mbrtowc_null_arg1], 295 [gl_cv_func_mbrtowc_null_arg1],
@@ -303,7 +304,7 @@ changequote(,)dnl
303 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; 304 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
304 esac 305 esac
305changequote([,])dnl 306changequote([,])dnl
306 if test $LOCALE_FR_UTF8 != none; then 307 if test "$LOCALE_EN_UTF8" != none; then
307 AC_RUN_IFELSE( 308 AC_RUN_IFELSE(
308 [AC_LANG_SOURCE([[ 309 [AC_LANG_SOURCE([[
309#include <locale.h> 310#include <locale.h>
@@ -314,7 +315,7 @@ int main ()
314{ 315{
315 int result = 0; 316 int result = 0;
316 317
317 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 318 if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
318 { 319 {
319 char input[] = "\303\237er"; 320 char input[] = "\303\237er";
320 mbstate_t state; 321 mbstate_t state;
@@ -351,7 +352,7 @@ dnl Result is gl_cv_func_mbrtowc_null_arg2.
351AC_DEFUN([gl_MBRTOWC_NULL_ARG2], 352AC_DEFUN([gl_MBRTOWC_NULL_ARG2],
352[ 353[
353 AC_REQUIRE([AC_PROG_CC]) 354 AC_REQUIRE([AC_PROG_CC])
354 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 355 AC_REQUIRE([gt_LOCALE_EN_UTF8])
355 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 356 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
356 AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], 357 AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
357 [gl_cv_func_mbrtowc_null_arg2], 358 [gl_cv_func_mbrtowc_null_arg2],
@@ -366,7 +367,7 @@ changequote(,)dnl
366 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; 367 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
367 esac 368 esac
368changequote([,])dnl 369changequote([,])dnl
369 if test $LOCALE_FR_UTF8 != none; then 370 if test "$LOCALE_EN_UTF8" != none; then
370 AC_RUN_IFELSE( 371 AC_RUN_IFELSE(
371 [AC_LANG_SOURCE([[ 372 [AC_LANG_SOURCE([[
372#include <locale.h> 373#include <locale.h>
@@ -374,7 +375,7 @@ changequote([,])dnl
374#include <wchar.h> 375#include <wchar.h>
375int main () 376int main ()
376{ 377{
377 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 378 if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
378 { 379 {
379 mbstate_t state; 380 mbstate_t state;
380 wchar_t wc; 381 wchar_t wc;
@@ -404,7 +405,7 @@ dnl Result is gl_cv_func_mbrtowc_retval.
404AC_DEFUN([gl_MBRTOWC_RETVAL], 405AC_DEFUN([gl_MBRTOWC_RETVAL],
405[ 406[
406 AC_REQUIRE([AC_PROG_CC]) 407 AC_REQUIRE([AC_PROG_CC])
407 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 408 AC_REQUIRE([gt_LOCALE_EN_UTF8])
408 AC_REQUIRE([gt_LOCALE_JA]) 409 AC_REQUIRE([gt_LOCALE_JA])
409 AC_REQUIRE([AC_CANONICAL_HOST]) 410 AC_REQUIRE([AC_CANONICAL_HOST])
410 AC_CACHE_CHECK([whether mbrtowc has a correct return value], 411 AC_CACHE_CHECK([whether mbrtowc has a correct return value],
@@ -422,7 +423,7 @@ changequote(,)dnl
422 gl_cv_func_mbrtowc_retval="guessing yes" ;; 423 gl_cv_func_mbrtowc_retval="guessing yes" ;;
423 esac 424 esac
424changequote([,])dnl 425changequote([,])dnl
425 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ 426 if test "$LOCALE_EN_UTF8" != none || test $LOCALE_JA != none \
426 || { case "$host_os" in mingw* | windows*) true;; *) false;; esac; }; then 427 || { case "$host_os" in mingw* | windows*) true;; *) false;; esac; }; then
427 AC_RUN_IFELSE( 428 AC_RUN_IFELSE(
428 [AC_LANG_SOURCE([[ 429 [AC_LANG_SOURCE([[
@@ -434,8 +435,8 @@ int main ()
434 int result = 0; 435 int result = 0;
435 int found_some_locale = 0; 436 int found_some_locale = 0;
436 /* This fails on Solaris. */ 437 /* This fails on Solaris. */
437 if (strcmp ("$LOCALE_FR_UTF8", "none") != 0 438 if (strcmp ("$LOCALE_EN_UTF8", "none") != 0
438 && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 439 && setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
439 { 440 {
440 char input[] = "B\303\274\303\237er"; /* "Büßer" */ 441 char input[] = "B\303\274\303\237er"; /* "Büßer" */
441 mbstate_t state; 442 mbstate_t state;
@@ -649,8 +650,8 @@ int main ()
649 [:]) 650 [:])
650 ;; 651 ;;
651 *) 652 *)
652 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 653 AC_REQUIRE([gt_LOCALE_EN_UTF8])
653 if test $LOCALE_FR_UTF8 != none; then 654 if test "$LOCALE_EN_UTF8" != none; then
654 AC_RUN_IFELSE( 655 AC_RUN_IFELSE(
655 [AC_LANG_SOURCE([[ 656 [AC_LANG_SOURCE([[
656#include <locale.h> 657#include <locale.h>
@@ -658,7 +659,7 @@ int main ()
658#include <wchar.h> 659#include <wchar.h>
659int main () 660int main ()
660{ 661{
661 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 662 if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
662 { 663 {
663 wchar_t wc = (wchar_t) 0xBADFACE; 664 wchar_t wc = (wchar_t) 0xBADFACE;
664 mbstate_t state; 665 mbstate_t state;