]> Savannah Git Hosting - gnulib.git/commitdiff
mbrtowc, mbrtoc32: Simplify autoconf macros.
authorBruno Haible <bruno@clisp.org>
Tue, 27 Jun 2023 19:19:28 +0000 (21:19 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Jun 2023 08:39:33 +0000 (10:39 +0200)
* 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.

ChangeLog
m4/mbrtoc32.m4
m4/mbrtowc.m4

index 820285f2d9ca74b8e226887bbc005649def16efb..a200f5078a4d8d95539cf5de0b328e7106f14b74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
index 52dd913f8a518aa524ba76d3453ca1ea99ec1ac6..f5798db4a36dab90836836f080d62d3668ded596 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -87,15 +87,6 @@ AC_DEFUN([gl_MBRTOC32_EMPTY_INPUT],
   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__
@@ -111,7 +102,12 @@ changequote([,])dnl
            }]])],
         [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
+        ])
     ])
 ])
 
@@ -125,12 +121,7 @@ AC_DEFUN([gl_MBRTOC32_C_LOCALE],
   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>
@@ -154,13 +145,14 @@ AC_DEFUN([gl_MBRTOC32_C_LOCALE],
               }
             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
+       ])
     ])
 ])
 
index 6173ded2ff1518c2c0c59243985c3f31f2eafb5b..04e282d24a80a4c370673bf8291fef42bcca0fae 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -682,31 +682,26 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
   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
+       ])
     ])
 ])
 
@@ -724,12 +719,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
   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>
@@ -750,13 +740,14 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
               }
             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
+       ])
     ])
 ])