summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-04-01 14:51:22 +0200
committerBruno Haible <bruno@clisp.org>2023-04-01 14:51:22 +0200
commitbbf0d3fdf25e8f85c7751ac0ee90a0f50a0f054d (patch)
tree34feb43a426755fe6ec95146d7751e151720979b /m4
parent154a389b7cc0654a4fbec0faf4f0ddc3e89a947a (diff)
downloadgnulib-bbf0d3fdf25e8f85c7751ac0ee90a0f50a0f054d.tar.gz
vasnwprintf-posix: Fix behaviour in the C locale.
* lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_C is set, implement the 'c' directive here. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, define NEED_WPRINTF_DIRECTIVE_C. * modules/vasnwprintf (Files): Add m4/mbrtowc.m4. * tests/test-vasnwprintf-posix.c (test_function): Add tests of %s and %c in the C locale. * doc/posix-functions/fwprintf.texi: Mention the C locale behaviour bug. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
Diffstat (limited to 'm4')
-rw-r--r--m4/vasnprintf.m411
1 files changed, 10 insertions, 1 deletions
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
index 929f3d80af..86133b30b1 100644
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 47
+# vasnprintf.m4 serial 48
dnl Copyright (C) 2002-2004, 2006-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,
@@ -105,6 +105,15 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF],
that contains null wide characters.])
;;
esac
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *)
+ AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1],
+ [Define if the vasnwprintf implementation needs special code for
+ the 'c' directive.])
+ ;;
+ esac
gl_MUSL_LIBC
gl_PREREQ_VASNXPRINTF
])