diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | lib/mbrtowc.c | 4 | ||||
-rw-r--r-- | m4/mbrtowc.m4 | 18 |
3 files changed, 21 insertions, 11 deletions
@@ -1,5 +1,15 @@ 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. * lib/uchar.in.h (_GL_LARGE_CHAR32_T): New macro. (c32tob): New declaration. diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c index 60c29ca3c5..14467e6b4a 100644 --- a/lib/mbrtowc.c +++ b/lib/mbrtowc.c @@ -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; diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index 8e5c7c1948..c747ea2093 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -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 ]) ]) |