]> Savannah Git Hosting - gnulib.git/commitdiff
vasnwprintf-gnu: New module.
authorBruno Haible <bruno@clisp.org>
Fri, 24 Mar 2023 11:15:42 +0000 (12:15 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 24 Mar 2023 11:15:42 +0000 (12:15 +0100)
* m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_IS_POSIX): New macro.
(gl_FUNC_VASNWPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/vasnwprintf-gnu.m4: New file, based on m4/vasnprintf-gnu.m4.
* modules/vasnwprintf-gnu: New file, based on modules/vasnprintf-gnu.

ChangeLog
m4/vasnwprintf-gnu.m4 [new file with mode: 0644]
m4/vasnwprintf-posix.m4
modules/vasnwprintf-gnu [new file with mode: 0644]

index ddadbad8d1563a4ffe0adf058cffd5e38745c9a7..994d8792f7111baf0aac56403247ce5fd9ed1267 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-03-24  Bruno Haible  <bruno@clisp.org>
+
+       vasnwprintf-gnu: New module.
+       * m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_IS_POSIX): New macro.
+       (gl_FUNC_VASNWPRINTF_POSIX): Require it. Invoke
+       gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
+       * m4/vasnwprintf-gnu.m4: New file, based on m4/vasnprintf-gnu.m4.
+       * modules/vasnwprintf-gnu: New file, based on modules/vasnprintf-gnu.
+
 2023-03-24  Bruno Haible  <bruno@clisp.org>
 
        obstack-printf-gnu: Add tests.
diff --git a/m4/vasnwprintf-gnu.m4 b/m4/vasnwprintf-gnu.m4
new file mode 100644 (file)
index 0000000..ee89bef
--- /dev/null
@@ -0,0 +1,26 @@
+# vasnwprintf-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_VASNWPRINTF_GNU],
+[
+  AC_REQUIRE([gl_FUNC_VASNWPRINTF_IS_POSIX])
+  AC_REQUIRE([gl_PRINTF_DIRECTIVE_UPPERCASE_B])
+  gl_cv_func_vasnwprintf_gnu=no
+  if test $gl_cv_func_vasnwprintf_posix = yes; then
+    case "$gl_cv_func_printf_directive_uppercase_b" in
+      *yes)
+        # vasnwprintf exists and is already POSIX compliant and GNU compatible.
+        gl_cv_func_vasnwprintf_gnu=yes
+        ;;
+    esac
+  fi
+  if test $gl_cv_func_vasnwprintf_gnu = no; then
+    dnl Note: This invokes gl_PREREQ_VASNPRINTF_DIRECTIVE_LC although not needed
+    dnl here. Doesn't matter.
+    gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+    gl_FUNC_VASNWPRINTF
+  fi
+])
index d9dc41fa9767aac303aef6cc7b763bfba40d9960..310b4ffe603707bed2eb5b33b2e5ec3b8603513c 100644 (file)
@@ -1,4 +1,4 @@
-# vasnwprintf-posix.m4 serial 2
+# vasnwprintf-posix.m4 serial 3
 dnl Copyright (C) 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,
@@ -6,17 +6,18 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_VASNWPRINTF_POSIX],
 [
-  gl_FUNC_VASNWPRINTF
-  gl_PREREQ_VASNPRINTF_LONG_DOUBLE
-  gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
-  gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
-  gl_PREREQ_VASNPRINTF_DIRECTIVE_A
-  gl_PREREQ_VASNPRINTF_DIRECTIVE_B
-  gl_PREREQ_VASNPRINTF_DIRECTIVE_F
-  gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
-  gl_PREREQ_VASNPRINTF_FLAG_GROUPING
-  gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
-  gl_PREREQ_VASNPRINTF_FLAG_ZERO
-  gl_PREREQ_VASNPRINTF_PRECISION
-  gl_PREREQ_VASNPRINTF_ENOMEM
+  AC_REQUIRE([gl_FUNC_VASNWPRINTF_IS_POSIX])
+  if test $gl_cv_func_vasnwprintf_posix = no; then
+    dnl Note: This invokes gl_PREREQ_VASNPRINTF_DIRECTIVE_LC although not needed
+    dnl here. Doesn't matter.
+    gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+    gl_FUNC_VASNWPRINTF
+  fi
+])
+
+dnl Test whether vasnwprintf exists and is POSIX compliant.
+dnl Result is gl_cv_func_vasnwprintf_posix.
+AC_DEFUN([gl_FUNC_VASNWPRINTF_IS_POSIX],
+[
+  gl_cv_func_vasnwprintf_posix=no
 ])
diff --git a/modules/vasnwprintf-gnu b/modules/vasnwprintf-gnu
new file mode 100644 (file)
index 0000000..582a185
--- /dev/null
@@ -0,0 +1,32 @@
+Description:
+POSIX and GNU compatible vswprintf 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 'vasnwprintf' module, if
+that module occurs among the main modules in lib/.
+
+Files:
+m4/vasnwprintf-gnu.m4
+
+Depends-on:
+vasnwprintf-posix
+
+configure.ac:
+gl_FUNC_VASNWPRINTF_GNU
+
+Makefile.am:
+
+Include:
+"vasnwprintf.h"
+
+Link:
+$(MBRTOWC_LIB)
+
+License:
+LGPLv2+
+
+Maintainer:
+all