From 0645e170eadd356967b0690ba8208d85e8042edd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 23 Mar 2023 13:51:41 +0100 Subject: vasnprintf-gnu: New module. Suggested by Eric Blake in . * lib/printf-parse.c (PRINTF_PARSE): Recognize the 'B' conversion. * lib/printf-parse.h: Update comments. * lib/wprintf-parse.h: Likewise. * lib/vasnprintf.c (MAX_ROOM_NEEDED): Treat the 'B' conversion like 'b'. (VASNPRINTF): Implement 'B' conversion if NEED_PRINTF_DIRECTIVE_UPPERCASE_B is set. Support the 'B' conversion if requested. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): When cross-compiling, guess yes on glibc >= 2.35. (gl_PRINTF_DIRECTIVE_UPPERCASE_B): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS): Renamed from gl_PREREQ_VASNPRINTF_WITH_EXTRAS. (gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B, gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS): New macros. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VASNPRINTF_POSIX. (gl_FUNC_VASNPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vasnprintf-gnu.m4: New file. * modules/vasnprintf-gnu: New file. * modules/c-vasnprintf (configure.ac): Update. * modules/unistdio/u8-vasnprintf (configure.ac): Likewise. * modules/unistdio/u8-u8-vasnprintf (configure.ac): Likewise. * modules/unistdio/u16-vasnprintf (configure.ac): Likewise. * modules/unistdio/u16-u16-vasnprintf (configure.ac): Likewise. * modules/unistdio/u32-vasnprintf (configure.ac): Likewise. * modules/unistdio/u32-u32-vasnprintf (configure.ac): Likewise. * modules/unistdio/ulc-vasnprintf (configure.ac): Likewise. --- modules/vasnprintf-gnu | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 modules/vasnprintf-gnu (limited to 'modules/vasnprintf-gnu') diff --git a/modules/vasnprintf-gnu b/modules/vasnprintf-gnu new file mode 100644 index 0000000000..b5551f3011 --- /dev/null +++ b/modules/vasnprintf-gnu @@ -0,0 +1,29 @@ +Description: +POSIX and GNU compatible vsprintf with automatic memory allocation and bounded +output size. + +Comment: +This module should not be used as a dependency from a test module, +otherwise when this module occurs as a tests-related module, it will +have side effects on the compilation of the 'vasnprintf' module, if +that module occurs among the main modules in lib/. + +Files: +m4/vasnprintf-gnu.m4 + +Depends-on: +vasnprintf-posix + +configure.ac: +gl_FUNC_VASNPRINTF_GNU + +Makefile.am: + +Include: +"vasnprintf.h" + +License: +LGPLv2+ + +Maintainer: +all -- cgit v1.2.1