diff options
author | Bruno Haible <bruno@clisp.org> | 2023-03-24 11:17:22 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-03-24 11:17:22 +0100 |
commit | 21cb2b8ed03e0dd628c9be30734f563627a9b7e5 (patch) | |
tree | 69fbcf313a382556f47992719c1a3467562a846f /m4/vsprintf-gnu.m4 | |
parent | 0bba8aca9171f8b2e8835b0e2733541e8f119496 (diff) | |
download | gnulib-21cb2b8ed03e0dd628c9be30734f563627a9b7e5.tar.gz |
vsprintf-gnu: New module.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_VSPRINTF_POSIX.
(gl_FUNC_VSPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/vsprintf-gnu.m4: New file, based on m4/vsprintf-posix.m4.
* modules/vsprintf-gnu: New file, based on modules/vasnprintf-gnu.
* doc/posix-functions/vsprintf.texi: Mention the new module.
Diffstat (limited to 'm4/vsprintf-gnu.m4')
-rw-r--r-- | m4/vsprintf-gnu.m4 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/m4/vsprintf-gnu.m4 b/m4/vsprintf-gnu.m4 new file mode 100644 index 0000000000..4569e3599b --- /dev/null +++ b/m4/vsprintf-gnu.m4 @@ -0,0 +1,25 @@ +# vsprintf-gnu.m4 serial 1 +dnl Copyright (C) 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, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_VSPRINTF_GNU], +[ + AC_REQUIRE([gl_FUNC_VSPRINTF_IS_POSIX]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_UPPERCASE_B]) + gl_cv_func_vsprintf_gnu=no + if test $gl_cv_func_vsprintf_posix = yes; then + case "$gl_cv_func_printf_directive_uppercase_b" in + *yes) + # vsprintf is already POSIX compliant and GNU compatible. + gl_cv_func_vsprintf_gnu=yes + ;; + esac + fi + if test $gl_cv_func_vsprintf_gnu = no; then + gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS + gl_REPLACE_VASNPRINTF + gl_REPLACE_VSPRINTF + fi +]) |