The attached three patches fix 1) a few wrong cross-compilation guesses,
2) a test-vasnwprintf-posix failure on Alpine Linux 3.18 (musl libc 1.2.4): FAIL: test-vasnwprintf-posix ============================ ../../gltests/test-vasnwprintf-posix.c:3999: assertion 'result != NULL' failed Aborted FAIL test-vasnwprintf-posix (exit status: 134) 3) another failure of test-vasnwprintf-posix on Alpine Linux 3.18 (musl libc 1.2.4), once the previous one is fixed: FAIL: test-vasnwprintf-posix ============================ ../../gltests/test-vasnwprintf-posix.c:4074: assertion 'result != NULL' failed Aborted FAIL test-vasnwprintf-posix (exit status: 134) These two failures occurred in with musl libc 1.2.4 but not with musl libc 1.2.3 because in 1.2.4 HAVE_WORKING_SWPRINTF gets defined to 1 and thus the vasnwprintf implementation is based on swprintf rather than snprintf. In other words, The vasnwprintf implementation now takes a different code path, one that is sensitive to all kinds of swprintf bugs. 2023-06-12 Bruno Haible <br...@clisp.org> vasnwprintf-posix: Work around another musl libc bug. * m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LC): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it, and set NEED_WPRINTF_DIRECTIVE_LC if the %lc test failed. * lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_LC is set, do the processing for %lc and %ls ourselves. (local_wcslen): Update condition. * doc/posix-functions/swprintf.texi: Mention the %lc problem. 2023-06-12 Bruno Haible <br...@clisp.org> vasnwprintf-posix: Work around a musl libc bug. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Test also whether swprintf in the C locale is free of encoding errors, and set NEED_WPRINTF_DIRECTIVE_C if not. * doc/posix-functions/swprintf.texi: Clarify the list of platforms for the %c problem. 2023-06-12 Bruno Haible <br...@clisp.org> vasnwprintf: Fix some cross-compilation results. * m4/printf.m4 (gl_SWPRINTF_WORKS): Fix cross-compilation result for musl. (gl_SWPRINTF_DIRECTIVE_LA): Fix cross-compilation result for Android.
>From 8f0241490d9cd2b3a1eb43a0d2680fe857b7fc8d Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@clisp.org> Date: Mon, 12 Jun 2023 15:07:40 +0200 Subject: [PATCH 1/3] vasnwprintf: Fix some cross-compilation results. * m4/printf.m4 (gl_SWPRINTF_WORKS): Fix cross-compilation result for musl. (gl_SWPRINTF_DIRECTIVE_LA): Fix cross-compilation result for Android. --- ChangeLog | 7 +++++++ m4/printf.m4 | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32b21f1a93..406170ce6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-06-12 Bruno Haible <br...@clisp.org> + + vasnwprintf: Fix some cross-compilation results. + * m4/printf.m4 (gl_SWPRINTF_WORKS): Fix cross-compilation result for + musl. + (gl_SWPRINTF_DIRECTIVE_LA): Fix cross-compilation result for Android. + 2023-06-12 Bruno Haible <br...@clisp.org> warnings: Save memory and CPU time when inhibiting all warnings. diff --git a/m4/printf.m4 b/m4/printf.m4 index efb85a57af..509f3affb7 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 82 +# printf.m4 serial 83 dnl Copyright (C) 2003, 2007-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, @@ -1906,7 +1906,7 @@ AC_DEFUN([gl_SWPRINTF_WORKS] int main() { int result = 0; - { /* This test fails on musl, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */ + { /* This test fails on musl libc 1.2.3, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */ wchar_t buf[5] = { 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF }; int ret = swprintf (buf, 4, L"%cz", '\0'); /* Expected result: @@ -1937,7 +1937,7 @@ AC_DEFUN([gl_SWPRINTF_WORKS] # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_swprintf_works="guessing yes";; # Guess no on musl systems. - *-musl* | midipix*) gl_cv_func_swprintf_works="guessing yes";; + *-musl* | midipix*) gl_cv_func_swprintf_works="guessing no";; # Guess no on FreeBSD, NetBSD, OpenBSD, macOS, AIX. freebsd* | midnightbsd* | netbsd* | openbsd* | darwin* | aix*) gl_cv_func_swprintf_works="guessing no";; @@ -1999,8 +1999,8 @@ AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA] # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing yes";; # Guess yes on Android. - linux*-android*) gl_cv_func_swprintf_directive_la="guessing no";; - # Guess yes on native Windows. + linux*-android*) gl_cv_func_swprintf_directive_la="guessing yes";; + # Guess no on native Windows. mingw*) gl_cv_func_swprintf_directive_la="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_swprintf_directive_la="$gl_cross_guess_normal";; -- 2.34.1
>From 284bd54ebc28cd3b61596014adb3440ad2c65c2e Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@clisp.org> Date: Mon, 12 Jun 2023 16:48:03 +0200 Subject: [PATCH 2/3] vasnwprintf-posix: Work around a musl libc bug. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Test also whether swprintf in the C locale is free of encoding errors, and set NEED_WPRINTF_DIRECTIVE_C if not. * doc/posix-functions/swprintf.texi: Clarify the list of platforms for the %c problem. --- ChangeLog | 9 +++++ doc/posix-functions/swprintf.texi | 2 +- m4/vasnprintf.m4 | 55 +++++++++++++++++++++++++++---- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 406170ce6d..aebce47f42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2023-06-12 Bruno Haible <br...@clisp.org> + + vasnwprintf-posix: Work around a musl libc bug. + * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Test also whether swprintf + in the C locale is free of encoding errors, and set + NEED_WPRINTF_DIRECTIVE_C if not. + * doc/posix-functions/swprintf.texi: Clarify the list of platforms for + the %c problem. + 2023-06-12 Bruno Haible <br...@clisp.org> vasnwprintf: Fix some cross-compilation results. diff --git a/doc/posix-functions/swprintf.texi b/doc/posix-functions/swprintf.texi index 649b541ed0..68578e016b 100644 --- a/doc/posix-functions/swprintf.texi +++ b/doc/posix-functions/swprintf.texi @@ -72,7 +72,7 @@ @item In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail on some platforms: -glibc 2.35. +glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3, OpenBSD 7.2, Cygwin 2.9.0. @item When formatting an integer with grouping flag, this function inserts thousands separators even in the "C" locale on some platforms: diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 index 639b29a1f3..b733f9a848 100644 --- a/m4/vasnprintf.m4 +++ b/m4/vasnprintf.m4 @@ -1,4 +1,4 @@ -# vasnprintf.m4 serial 49 +# vasnprintf.m4 serial 50 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, @@ -107,13 +107,56 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF] 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.]) + *yes) + AC_CACHE_CHECK([whether swprintf in the C locale is free of encoding errors], + [gl_cv_func_swprintf_C_locale_sans_EILSEQ], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __USE_MINGW_ANSI_STDIO +# define __USE_MINGW_ANSI_STDIO 1 +#endif +#include <stdio.h> +#include <wchar.h> +int main() +{ + int result = 0; + { /* This test fails on glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3, + OpenBSD 7.2, Cygwin 2.9.0. + Reported at <https://www.openwall.com/lists/musl/2023/06/12/2>. */ + wchar_t buf[12]; + int ret = swprintf (buf, 12, L"%c", '\377'); + if (ret < 0) + result |= 1; + } + return result; +}]])], + [gl_cv_func_swprintf_C_locale_sans_EILSEQ=yes], + [gl_cv_func_swprintf_C_locale_sans_EILSEQ=no], + [case "$host_os" in + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing yes";; + # Guess no on musl systems. + *-musl* | midipix*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_swprintf_C_locale_sans_EILSEQ="$gl_cross_guess_normal";; + esac + ]) + ]) ;; esac + if case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in + *yes) false ;; + *) true ;; + esac \ + || case "$gl_cv_func_swprintf_C_locale_sans_EILSEQ" in + *yes) false ;; + *) true ;; + esac; then + AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1], + [Define if the vasnwprintf implementation needs special code for + the 'c' directive.]) + fi gl_SWPRINTF_DIRECTIVE_LA case "$gl_cv_func_swprintf_directive_la" in *yes) ;; -- 2.34.1
>From 94a7cdb7496bfd7d44ac26938ecd219c75ce6f34 Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@clisp.org> Date: Mon, 12 Jun 2023 18:39:49 +0200 Subject: [PATCH 3/3] vasnwprintf-posix: Work around another musl libc bug. * m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LC): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it, and set NEED_WPRINTF_DIRECTIVE_LC if the %lc test failed. * lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_LC is set, do the processing for %lc and %ls ourselves. (local_wcslen): Update condition. * doc/posix-functions/swprintf.texi: Mention the %lc problem. --- ChangeLog | 11 +++ doc/posix-functions/swprintf.texi | 3 + lib/vasnprintf.c | 6 +- m4/printf.m4 | 132 ++++++++++++++++++++---------- m4/vasnprintf.m4 | 9 ++ 5 files changed, 116 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index aebce47f42..e2eb7e6faa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2023-06-12 Bruno Haible <br...@clisp.org> + + vasnwprintf-posix: Work around another musl libc bug. + * m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LC): New macro. + * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it, and set + NEED_WPRINTF_DIRECTIVE_LC if the %lc test failed. + * lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_LC is set, do + the processing for %lc and %ls ourselves. + (local_wcslen): Update condition. + * doc/posix-functions/swprintf.texi: Mention the %lc problem. + 2023-06-12 Bruno Haible <br...@clisp.org> vasnwprintf-posix: Work around a musl libc bug. diff --git a/doc/posix-functions/swprintf.texi b/doc/posix-functions/swprintf.texi index 68578e016b..7883bfbe44 100644 --- a/doc/posix-functions/swprintf.texi +++ b/doc/posix-functions/swprintf.texi @@ -74,6 +74,9 @@ on some platforms: glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3, OpenBSD 7.2, Cygwin 2.9.0. @item +The @code{%lc} directive may fail on some platforms: +musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3, OpenBSD 7.2. +@item When formatting an integer with grouping flag, this function inserts thousands separators even in the "C" locale on some platforms: NetBSD 5.1. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 63a6cd60f3..9ad31b2a08 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -247,7 +247,7 @@ local_strnlen (const char *string, size_t maxlen) # endif #endif -#if (((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T +#if (((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T # if HAVE_WCSLEN # define local_wcslen wcslen # else @@ -2765,14 +2765,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } #endif -#if WIDE_CHAR_VERSION && !DCHAR_IS_TCHAR +#if WIDE_CHAR_VERSION && (!DCHAR_IS_TCHAR || NEED_WPRINTF_DIRECTIVE_LC) else if ((dp->conversion == 's' && a.arg[dp->arg_index].type == TYPE_WIDE_STRING) || (dp->conversion == 'c' && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR)) { /* %ls or %lc in vasnwprintf. See the specification of - fwprintf. */ + fwprintf. */ /* It would be silly to use snprintf ("%ls", ...) and then convert back the result from a char[] to a wchar_t[]. Instead, just copy the argument wchar_t[] to the result. */ diff --git a/m4/printf.m4 b/m4/printf.m4 index 509f3affb7..8b8f01067f 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 83 +# printf.m4 serial 84 dnl Copyright (C) 2003, 2007-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, @@ -2009,6 +2009,52 @@ AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA] ]) ]) +dnl Test whether the *wprintf family of functions supports the 'lc' conversion +dnl specifier for all wide characters. +dnl (ISO C11, POSIX:2001) +dnl Result is gl_cv_func_swprintf_directive_lc. + +AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LC], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether swprintf supports the 'lc' directive], + [gl_cv_func_swprintf_directive_lc], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <wchar.h> +static wchar_t buf[100]; +static wint_t L_invalid = (wchar_t) 0x76543210; +int main () +{ + int result = 0; + /* This catches a musl libc 1.2.4, Android bug. + Reported at <https://www.openwall.com/lists/musl/2023/06/12/3>. */ + if (swprintf (buf, sizeof (buf) / sizeof (wchar_t), + L"%lc %d", L_invalid, 33, 44, 55) < 0) + result |= 1; + return result; +}]])], + [gl_cv_func_swprintf_directive_lc=yes], + [gl_cv_func_swprintf_directive_lc=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_swprintf_directive_lc="guessing yes";; + # Guess no on musl systems. + *-musl* | midipix*) gl_cv_func_swprintf_directive_lc="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_swprintf_directive_lc="guessing no";; + # Guess yes on native Windows. + mingw*) gl_cv_func_swprintf_directive_lc="guessing yes";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_swprintf_directive_lc="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + dnl The results of these tests on various platforms are: dnl dnl 1 = gl_PRINTF_SIZES_C99 @@ -2037,6 +2083,7 @@ AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA] dnl 24 = gl_VSNPRINTF_ZEROSIZE_C99 dnl 25 = gl_SWPRINTF_WORKS dnl 26 = gl_SWPRINTF_DIRECTIVE_LA +dnl 27 = gl_SWPRINTF_DIRECTIVE_LC dnl dnl 1 = checking whether printf supports size specifiers as in C99... dnl 2 = checking whether printf supports size specifiers as in C23... @@ -2064,47 +2111,48 @@ AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA] dnl 24 = checking whether vsnprintf respects a zero size as in C99... dnl 25 = checking whether swprintf works... dnl 26 = checking whether swprintf supports the 'La' and 'LA' directives... +dnl 27 = checking whether swprintf supports the 'lc' directive... dnl dnl . = yes, # = no. dnl -dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -dnl musl libc 1.2.3 . # . . . . # # . . . . . . . . . . . . . . . . # . -dnl glibc 2.35 . # . . . . . . . . . # . . . . . . . . . . . . . . -dnl glibc 2.5 . # . . . . # # . . . # . . . . . . . . . . . . . # -dnl glibc 2.3.6 . # . . . # # # . . . # . . . . . . . . . . . . . # -dnl FreeBSD 13.0 . # . . . # # # . . . # . . . . . # . . . . . . # . -dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . # . . . # . # . . . . . . # ? -dnl Mac OS X 10.13.5 . # . . # # # # . # . # . . . . . . . . . # . . # ? -dnl Mac OS X 10.5.8 . # . . # # # # . . . # . . . # . . . . . . . . # ? -dnl Mac OS X 10.3.9 . # . . . # # # . . . # . . . # . # . . . . . . # ? -dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . # . . . . . # . . . . . . # . -dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # # . # . # . # . . . . . . # ? -dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . . ? . . . . . . ? ? -dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . . # . . . . . . ? ? -dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # # # . . . . . . ? ? -dnl Solaris 11.4 . # . # # # # # . . # # . . . # . . . . . . . . . ? -dnl Solaris 11.3 . # . . . # # # . . # # . . . . . . . . . . . . . ? -dnl Solaris 11.0 . # . # # # # # . . # # . . . # . . . . . . . . ? ? -dnl Solaris 10 . # . # # # # # . . # # . . . # # . . . . . . . ? ? -dnl Solaris 2.6 ... 9 # # . # # # # # # . # # . . . # # . . . # . . . ? ? -dnl Solaris 2.5.1 # # . # # # # # # . # # . . . # . . # # # # # # ? ? -dnl AIX 7.1 . # . # # # # # . . . # . . . # # . . . . . . . # . -dnl AIX 5.2 . # . # # # # # . . . # . . . # . . . . . . . . # ? -dnl AIX 4.3.2, 5.1 # # . # # # # # # . . # . . . # . . . . # . . . # ? -dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # . . . . # # . . ? ? -dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # . . . . # # . # ? ? -dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # . . . . # # ? # ? ? -dnl IRIX 6.5 # # . # # # # # # . # # . . . # . . . . # . . . # ? -dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # . . . . # . . # ? ? -dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # . . # # # # # # ? ? -dnl NetBSD 9.0 . # . . . # # # . . . # . . . . . . . . . . . . # . -dnl NetBSD 5.0 . # . . # # # # . . . # . . . # . # . . . . . . # ? -dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? # . ? ? ? ? ? . . . ? ? ? # ? -dnl NetBSD 3.0 . # . . . # # # # . ? # # # ? # . # . . . . . . # ? -dnl Haiku . # . . # # # # # . # ? . . . . . ? . . ? . . . . # -dnl BeOS # # # . # # # # # . ? ? # . ? . # ? . . ? . . . ? ? -dnl Android 4.3 . # . # # # # # # # # ? . # . # . # . . . # . . ? ? -dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # # ? . # # # . . # ? -dnl MSVC 9 # # # # # # # # # # . ? # # . # # ? # # # # . . # ? -dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . . ? . . . . . . # ? -dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # # ? . # # # . . # ? +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 +dnl musl libc 1.2.3 . # . . . . # # . . . . . . . . . . . . . . . . # . # +dnl glibc 2.35 . # . . . . . . . . . # . . . . . . . . . . . . . . . +dnl glibc 2.5 . # . . . . # # . . . # . . . . . . . . . . . . . # . +dnl glibc 2.3.6 . # . . . # # # . . . # . . . . . . . . . . . . . # . +dnl FreeBSD 13.0 . # . . . # # # . . . # . . . . . # . . . . . . # . # +dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . # . . . # . # . . . . . . # ? ? +dnl Mac OS X 10.13.5 . # . . # # # # . # . # . . . . . . . . . # . . # ? ? +dnl Mac OS X 10.5.8 . # . . # # # # . . . # . . . # . . . . . . . . # ? ? +dnl Mac OS X 10.3.9 . # . . . # # # . . . # . . . # . # . . . . . . # ? ? +dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . # . . . . . # . . . . . . # . # +dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # # . # . # . # . . . . . . # ? ? +dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . . ? . . . . . . ? ? ? +dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . . # . . . . . . ? ? ? +dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # # # . . . . . . ? ? ? +dnl Solaris 11.4 . # . # # # # # . . # # . . . # . . . . . . . . . # . +dnl Solaris 11.3 . # . . . # # # . . # # . . . . . . . . . . . . . # . +dnl Solaris 11.0 . # . # # # # # . . # # . . . # . . . . . . . . ? ? ? +dnl Solaris 10 . # . # # # # # . . # # . . . # # . . . . . . . . # . +dnl Solaris 2.6 ... 9 # # . # # # # # # . # # . . . # # . . . # . . . ? ? ? +dnl Solaris 2.5.1 # # . # # # # # # . # # . . . # . . # # # # # # ? ? ? +dnl AIX 7.1 . # . # # # # # . . . # . . . # # . . . . . . . # . . +dnl AIX 5.2 . # . # # # # # . . . # . . . # . . . . . . . . # ? ? +dnl AIX 4.3.2, 5.1 # # . # # # # # # . . # . . . # . . . . # . . . # ? ? +dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # . . . . # # . . ? ? ? +dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # . . . . # # . # ? ? ? +dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # . . . . # # ? # ? ? ? +dnl IRIX 6.5 # # . # # # # # # . # # . . . # . . . . # . . . # ? ? +dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # . . . . # . . # ? ? ? +dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # . . # # # # # # ? ? ? +dnl NetBSD 9.0 . # . . . # # # . . . # . . . . . . . . . . . . # . # +dnl NetBSD 5.0 . # . . # # # # . . . # . . . # . # . . . . . . # ? ? +dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? # . ? ? ? ? ? . . . ? ? ? # ? ? +dnl NetBSD 3.0 . # . . . # # # # . ? # # # ? # . # . . . . . . # ? ? +dnl Haiku . # . . # # # # # . # ? . . . . . ? . . ? . . . . # . +dnl BeOS # # # . # # # # # . ? ? # . ? . # ? . . ? . . . ? ? ? +dnl Android 4.3 . # . # # # # # # # # ? . # . # . # . . . # . . ? ? ? +dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # # ? . # # # . . # ? ? +dnl MSVC 9 # # # # # # # # # # . ? # # . # # ? # # # # . . # ? ? +dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . . ? . . . . . . # ? ? +dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # # ? . # # # . . # ? ? diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 index b733f9a848..df87b9e798 100644 --- a/m4/vasnprintf.m4 +++ b/m4/vasnprintf.m4 @@ -166,6 +166,15 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF] the 'a' directive with 'long double' arguments.]) ;; esac + gl_SWPRINTF_DIRECTIVE_LC + case "$gl_cv_func_swprintf_directive_lc" in + *yes) ;; + *) + AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LC], [1], + [Define if the vasnwprintf implementation needs special code for + the 'lc' directive.]) + ;; + esac gl_MUSL_LIBC gl_PREREQ_VASNXPRINTF ]) -- 2.34.1