summaryrefslogtreecommitdiffstats
path: root/gl/m4/wcrtomb.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/wcrtomb.m4')
-rw-r--r--gl/m4/wcrtomb.m419
1 files changed, 10 insertions, 9 deletions
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
index 35dff6f0..a69f17c4 100644
--- a/gl/m4/wcrtomb.m4
+++ b/gl/m4/wcrtomb.m4
@@ -1,9 +1,10 @@
1# wcrtomb.m4 1# wcrtomb.m4
2# serial 19 2# serial 22
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2008-2026 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
7 8
8AC_DEFUN([gl_FUNC_WCRTOMB], 9AC_DEFUN([gl_FUNC_WCRTOMB],
9[ 10[
@@ -32,11 +33,11 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
32 dnl fi 33 dnl fi
33 if test $REPLACE_WCRTOMB = 0; then 34 if test $REPLACE_WCRTOMB = 0; then
34 dnl On Android 4.3, wcrtomb produces wrong characters in the C locale. 35 dnl On Android 4.3, wcrtomb produces wrong characters in the C locale.
35 dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL) 36 dnl On AIX 4.3 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL)
36 dnl sometimes returns 0 instead of 1. 37 dnl sometimes returns 0 instead of 1.
37 AC_REQUIRE([AC_PROG_CC]) 38 AC_REQUIRE([AC_PROG_CC])
38 AC_REQUIRE([gt_LOCALE_FR]) 39 AC_REQUIRE([gt_LOCALE_FR])
39 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 40 AC_REQUIRE([gt_LOCALE_EN_UTF8])
40 AC_REQUIRE([gt_LOCALE_JA]) 41 AC_REQUIRE([gt_LOCALE_JA])
41 AC_REQUIRE([gt_LOCALE_ZH_CN]) 42 AC_REQUIRE([gt_LOCALE_ZH_CN])
42 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 43 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -82,15 +83,15 @@ int main ()
82 dnl is present. 83 dnl is present.
83changequote(,)dnl 84changequote(,)dnl
84 case "$host_os" in 85 case "$host_os" in
85 # Guess no on AIX 4, OSF/1, Solaris, native Windows. 86 # Guess no on AIX 4, Solaris, native Windows.
86 aix4* | osf* | solaris* | mingw* | windows*) 87 aix4* | solaris* | mingw* | windows*)
87 gl_cv_func_wcrtomb_retval="guessing no" ;; 88 gl_cv_func_wcrtomb_retval="guessing no" ;;
88 # Guess yes otherwise. 89 # Guess yes otherwise.
89 *) 90 *)
90 gl_cv_func_wcrtomb_retval="guessing yes" ;; 91 gl_cv_func_wcrtomb_retval="guessing yes" ;;
91 esac 92 esac
92changequote([,])dnl 93changequote([,])dnl
93 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then 94 if test $LOCALE_FR != none || test "$LOCALE_EN_UTF8" != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
94 AC_RUN_IFELSE( 95 AC_RUN_IFELSE(
95 [AC_LANG_SOURCE([[ 96 [AC_LANG_SOURCE([[
96#include <locale.h> 97#include <locale.h>
@@ -106,8 +107,8 @@ int main ()
106 if (wcrtomb (NULL, 0, NULL) != 1) 107 if (wcrtomb (NULL, 0, NULL) != 1)
107 result |= 1; 108 result |= 1;
108 } 109 }
109 if (strcmp ("$LOCALE_FR_UTF8", "none") != 0 110 if (strcmp ("$LOCALE_EN_UTF8", "none") != 0
110 && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 111 && setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
111 { 112 {
112 if (wcrtomb (NULL, 0, NULL) != 1) 113 if (wcrtomb (NULL, 0, NULL) != 1)
113 result |= 2; 114 result |= 2;