summaryrefslogtreecommitdiffstats
path: root/gl/m4/btowc.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/btowc.m4')
-rw-r--r--gl/m4/btowc.m447
1 files changed, 3 insertions, 44 deletions
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
index 59d52be6..93c9d769 100644
--- a/gl/m4/btowc.m4
+++ b/gl/m4/btowc.m4
@@ -1,6 +1,6 @@
1# btowc.m4 1# btowc.m4
2# serial 15 2# serial 16
3dnl Copyright (C) 2008-2025 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.
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_BTOWC],
13 13
14 dnl Check whether <wchar.h> is usable at all, first. Otherwise the test 14 dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
15 dnl program below may lead to an endless loop. See 15 dnl program below may lead to an endless loop. See
16 dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. 16 dnl <https://gcc.gnu.org/PR42440>.
17 AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) 17 AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
18 18
19 AC_CHECK_FUNCS_ONCE([btowc]) 19 AC_CHECK_FUNCS_ONCE([btowc])
@@ -54,43 +54,6 @@ changequote([,])dnl
54 ]) 54 ])
55 ]) 55 ])
56 56
57 dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
58 AC_CACHE_CHECK([whether btowc(EOF) is correct],
59 [gl_cv_func_btowc_eof],
60 [
61 dnl Initial guess, used when cross-compiling or when no suitable locale
62 dnl is present.
63changequote(,)dnl
64 case "$host_os" in
65 # Guess no on IRIX.
66 irix*) gl_cv_func_btowc_eof="guessing no" ;;
67 # Guess yes on native Windows.
68 mingw* | windows*) gl_cv_func_btowc_eof="guessing yes" ;;
69 # Guess yes otherwise.
70 *) gl_cv_func_btowc_eof="guessing yes" ;;
71 esac
72changequote([,])dnl
73 if test $LOCALE_FR != none; then
74 AC_RUN_IFELSE(
75 [AC_LANG_SOURCE([[
76#include <locale.h>
77#include <stdio.h>
78#include <wchar.h>
79int main ()
80{
81 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
82 {
83 if (btowc (EOF) != WEOF)
84 return 1;
85 }
86 return 0;
87}]])],
88 [gl_cv_func_btowc_eof=yes],
89 [gl_cv_func_btowc_eof=no],
90 [:])
91 fi
92 ])
93
94 dnl On mingw, in the C locale, btowc is inconsistent with mbrtowc: 57 dnl On mingw, in the C locale, btowc is inconsistent with mbrtowc:
95 dnl mbrtowc avoids calling MultiByteToWideChar when MB_CUR_MAX is 1 and 58 dnl mbrtowc avoids calling MultiByteToWideChar when MB_CUR_MAX is 1 and
96 dnl ___lc_codepage_func() is 0, but btowc is lacking this special case. 59 dnl ___lc_codepage_func() is 0, but btowc is lacking this special case.
@@ -146,10 +109,6 @@ int main ()
146 *yes) ;; 109 *yes) ;;
147 *) REPLACE_BTOWC=1 ;; 110 *) REPLACE_BTOWC=1 ;;
148 esac 111 esac
149 case "$gl_cv_func_btowc_eof" in
150 *yes) ;;
151 *) REPLACE_BTOWC=1 ;;
152 esac
153 case "$gl_cv_func_btowc_consistent" in 112 case "$gl_cv_func_btowc_consistent" in
154 *yes) ;; 113 *yes) ;;
155 *) REPLACE_BTOWC=1 ;; 114 *) REPLACE_BTOWC=1 ;;