summaryrefslogtreecommitdiff
path: root/m4/sprintf-posix.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-03-07 03:47:50 +0000
committerBruno Haible <bruno@clisp.org>2007-03-07 03:47:50 +0000
commitccd54782ae73477aa3f3987ab04db9e6fde025d6 (patch)
treeca5e135936d28aaac01b13f76e759ea57337fe0b /m4/sprintf-posix.m4
parentffd3c1bee8a5ad6aac459436d9a438762d7320d3 (diff)
downloadgnulib-ccd54782ae73477aa3f3987ab04db9e6fde025d6.tar.gz
New module 'sprintf-posix'.
Diffstat (limited to 'm4/sprintf-posix.m4')
-rw-r--r--m4/sprintf-posix.m438
1 files changed, 38 insertions, 0 deletions
diff --git a/m4/sprintf-posix.m4 b/m4/sprintf-posix.m4
new file mode 100644
index 0000000000..bd28762ec8
--- /dev/null
+++ b/m4/sprintf-posix.m4
@@ -0,0 +1,38 @@
+# sprintf-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_SPRINTF_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])
+ if expr "$gl_cv_func_printf_sizes_c99" : ".*yes" > /dev/null \
+ && expr "$gl_cv_func_printf_directive_a" : ".*yes" > /dev/null \
+ && expr "$gl_cv_func_printf_directive_n" : ".*yes" > /dev/null \
+ && expr "$gl_cv_func_printf_positions" : ".*yes" > /dev/null; then
+ : # sprintf exists and is already POSIX compliant.
+ else
+ 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_SPRINTF
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_SPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_LIBOBJ([sprintf])
+ REPLACE_SPRINTF=1
+ gl_PREREQ_SPRINTF
+])
+
+AC_DEFUN([gl_PREREQ_SPRINTF], [:])