]> Savannah Git Hosting - gnulib.git/commitdiff
mbrtowc: Include function name in macro names.
authorBruno Haible <bruno@clisp.org>
Wed, 1 Jan 2020 21:04:47 +0000 (22:04 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 1 Jan 2020 21:04:47 +0000 (22:04 +0100)
* m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Define
MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not C_LOCALE_MAYBE_EILSEQ.
(gl_MBRTOWC_C_LOCALE): Change cache variable name to
gl_cv_func_mbrtowc_C_locale_sans_EILSEQ.
* lib/mbrtowc.c: Test MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not
C_LOCALE_MAYBE_EILSEQ.

ChangeLog
lib/mbrtowc.c
m4/mbrtowc.m4

index 9e6db1a0eb48e1109048998958874f65e68a025c..8db5b3890b5319be0bc673a2fad9e8c8ecac4eaa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-01-01  Bruno Haible  <bruno@clisp.org>
+
+       mbrtowc: Include function name in macro names.
+       * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Define
+       MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not C_LOCALE_MAYBE_EILSEQ.
+       (gl_MBRTOWC_C_LOCALE): Change cache variable name to
+       gl_cv_func_mbrtowc_C_locale_sans_EILSEQ.
+       * lib/mbrtowc.c: Test MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not
+       C_LOCALE_MAYBE_EILSEQ.
+
 2020-01-01  Bruno Haible  <bruno@clisp.org>
 
        c32tob: New module.
index 60c29ca3c5369ec998f6caa1322a197a3a1ee679..14467e6b4ae412aea857995e4af81c43e418a4e2 100644 (file)
@@ -20,7 +20,7 @@
 /* Specification.  */
 #include <wchar.h>
 
-#if C_LOCALE_MAYBE_EILSEQ
+#if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
 # include "hard-locale.h"
 # include <locale.h>
 #endif
@@ -530,7 +530,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
     return 0;
 # endif
 
-# if C_LOCALE_MAYBE_EILSEQ
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
   if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE))
     {
       unsigned char uc = *s;
index 8e5c7c1948706f18d98f01304ce178d7db146f36..c747ea2093c48956fc32e3231372429a51504edb 100644 (file)
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 33  -*- coding: utf-8 -*-
+# mbrtowc.m4 serial 34  -*- coding: utf-8 -*-
 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2020 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -77,10 +77,10 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
            REPLACE_MBRTOWC=1
            ;;
       esac
-      case $gl_cv_C_locale_sans_EILSEQ in
+      case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
         *yes) ;;
-        *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1],
-             [Define to 1 if the C locale may have encoding errors.])
+        *) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1],
+             [Define if the mbrtowc function may signal encoding errors in the C locale.])
            REPLACE_MBRTOWC=1
            ;;
       esac
@@ -629,11 +629,11 @@ 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_C_locale_sans_EILSEQ],
+    [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_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
+     gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
 
      AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
@@ -656,11 +656,11 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
               }
             return 0;
           ]])],
-      [gl_cv_C_locale_sans_EILSEQ=yes],
-      [gl_cv_C_locale_sans_EILSEQ=no],
+      [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_C_locale_sans_EILSEQ="guessing yes" ;;
+         mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
        esac
       ])
     ])