summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-03-09 02:40:14 +0000
committerBruno Haible <bruno@clisp.org>2007-03-09 02:40:14 +0000
commitd2b0c77abf5b72cbf78ec4e4e404c851950b0fef (patch)
treea9f0e3c77a60458bacab80fb8c75d3f34d96978f /m4
parenta6fbf3fef46779c0d9a2c28c91d89d0fc2843f00 (diff)
downloadgnulib-d2b0c77abf5b72cbf78ec4e4e404c851950b0fef.tar.gz
New module 'vfprintf-posix'.
Diffstat (limited to 'm4')
-rw-r--r--m4/stdio_h.m42
-rw-r--r--m4/vfprintf-posix.m452
2 files changed, 54 insertions, 0 deletions
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 14e7d75081..503cd34946 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -23,9 +23,11 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
[
GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
+ GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
dnl Assume proper GNU behavior unless another module says otherwise.
+ REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
diff --git a/m4/vfprintf-posix.m4 b/m4/vfprintf-posix.m4
new file mode 100644
index 0000000000..11cbfda427
--- /dev/null
+++ b/m4/vfprintf-posix.m4
@@ -0,0 +1,52 @@
+# vfprintf-posix.m4 serial 1
+dnl Copyright (C) 2007 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_VFPRINTF_POSIX],
+[
+ AC_REQUIRE([gl_EOVERFLOW])
+ AC_REQUIRE([gl_PRINTF_SIZES_C99])
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])
+ AC_REQUIRE([gl_PRINTF_POSITIONS])
+ gl_cv_func_vfprintf_posix=no
+ case "$gl_cv_func_printf_sizes_c99" in
+ *yes)
+ case "$gl_cv_func_printf_directive_a" in
+ *yes)
+ case "$gl_cv_func_printf_directive_n" in
+ *yes)
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ # vfprintf exists and is already POSIX compliant.
+ gl_cv_func_vfprintf_posix=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ if test $gl_cv_func_vfprintf_posix = no; then
+ if ! expr "$gl_cv_func_printf_directive_a" : ".*yes" > /dev/null; then
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1,
+ [Define if the vasnprintf implementation needs special code for
+ the 'a' and 'A' directives.])
+ fi
+ gl_REPLACE_VASNPRINTF
+ gl_REPLACE_VFPRINTF
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VFPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_LIBOBJ([vfprintf])
+ REPLACE_VFPRINTF=1
+ gl_PREREQ_VFPRINTF
+])
+
+AC_DEFUN([gl_PREREQ_VFPRINTF], [:])