+2023-06-28 Bruno Haible <bruno@clisp.org>
+
+ mbrtowc, mbrtoc32: Simplify autoconf macros.
+ * m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT, gl_MBRTOWC_C_LOCALE): Put
+ cross-compilation guess at the usual place.
+ * m4/mbrtoc32.m4 (gl_MBRTOC32_EMPTY_INPUT, gl_MBRTOC32_C_LOCALE):
+ Likewise.
+
2023-06-27 Bruno Haible <bruno@clisp.org>
c32*: Optionally enforce ISO C 23 semantics of char32_t.
-# mbrtoc32.m4 serial 15
+# mbrtoc32.m4 serial 16
dnl Copyright (C) 2014-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_CACHE_CHECK([whether mbrtoc32 works on empty input],
[gl_cv_func_mbrtoc32_empty_input],
[
- dnl Initial guess, used when cross-compiling or when no suitable locale
- dnl is present.
-changequote(,)dnl
- case "$host_os" in
- # Guess no on glibc systems.
- *-gnu* | gnu*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;;
- *) gl_cv_func_mbrtoc32_empty_input="guessing yes" ;;
- esac
-changequote([,])dnl
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#ifdef __HAIKU__
}]])],
[gl_cv_func_mbrtoc32_empty_input=yes],
[gl_cv_func_mbrtoc32_empty_input=no],
- [:])
+ [case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;;
+ *) gl_cv_func_mbrtoc32_empty_input="guessing yes" ;;
+ esac
+ ])
])
])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether the C locale is free of encoding errors],
[gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ],
- [
- dnl Initial guess, used when cross-compiling or when no suitable locale
- dnl is present.
- gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
-
- AC_RUN_IFELSE(
+ [AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <limits.h>
#include <locale.h>
}
return 0;
]])],
- [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=yes],
- [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=no],
- [case "$host_os" in
- # Guess yes on native Windows.
- mingw*) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="guessing yes" ;;
- esac
- ])
+ [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="guessing yes" ;;
+ *) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;;
+ esac
+ ])
])
])
-# mbrtowc.m4 serial 41 -*- coding: utf-8 -*-
+# mbrtowc.m4 serial 42 -*- coding: utf-8 -*-
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether mbrtowc works on empty input],
[gl_cv_func_mbrtowc_empty_input],
- [
- dnl Initial guess, used when cross-compiling or when no suitable locale
- dnl is present.
-changequote(,)dnl
- case "$host_os" in
- # Guess no on AIX and glibc systems.
- aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
- *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
- esac
-changequote([,])dnl
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
- #include <wchar.h>
- static wchar_t wc;
- static mbstate_t mbs;
- int
- main (void)
- {
- return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
- }]])],
- [gl_cv_func_mbrtowc_empty_input=yes],
- [gl_cv_func_mbrtowc_empty_input=no],
- [:])
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <wchar.h>
+ static wchar_t wc;
+ static mbstate_t mbs;
+ int
+ main (void)
+ {
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+ }]])],
+ [gl_cv_func_mbrtowc_empty_input=yes],
+ [gl_cv_func_mbrtowc_empty_input=no],
+ [case "$host_os" in
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ esac
+ ])
])
])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether the C locale is free of encoding errors],
[gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
- [
- dnl Initial guess, used when cross-compiling or when no suitable locale
- dnl is present.
- gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
-
- AC_RUN_IFELSE(
+ [AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <limits.h>
#include <locale.h>
}
return 0;
]])],
- [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
- [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
- [case "$host_os" in
- # Guess yes on native Windows.
- mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
- esac
- ])
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;;
+ esac
+ ])
])
])