Imported Upstream version 3.1.0
[debian/amanda] / config / gnulib / vasnprintf.m4
index c4d3f4fa07187d7898b2adb76a79cdc1917be8ea..01e8772f11c086dd435aed60b65d930d48875826 100644 (file)
@@ -1,12 +1,11 @@
-# vasnprintf.m4 serial 24
-dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 28
+dnl Copyright (C) 2002-2004, 2006-2009 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_VASNPRINTF],
 [
-  AC_REQUIRE([gl_EOVERFLOW])
   AC_CHECK_FUNCS_ONCE([vasnprintf])
   if test $ac_cv_func_vasnprintf = no; then
     gl_REPLACE_VASNPRINTF
@@ -21,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
   AC_LIBOBJ([printf-parse])
   AC_LIBOBJ([asnprintf])
   if test $ac_cv_func_vasnprintf = yes; then
-    AC_DEFINE([REPLACE_VASNPRINTF], 1,
+    AC_DEFINE([REPLACE_VASNPRINTF], [1],
       [Define if vasnprintf exists but is overridden by gnulib.])
   fi
   gl_PREREQ_PRINTF_ARGS
@@ -59,7 +58,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
-  AC_CHECK_FUNCS(snprintf wcslen)
+  AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
   AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
@@ -74,7 +73,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
+      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
         [Define if the vasnprintf implementation needs special code for
          'long double' arguments.])
       ;;
@@ -90,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1,
+      AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1],
         [Define if the vasnprintf implementation needs special code for
          infinite 'double' arguments.])
       ;;
@@ -111,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
         *yes)
           ;;
         *)
-          AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1,
+          AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1],
             [Define if the vasnprintf implementation needs special code for
              infinite 'long double' arguments.])
           ;;
@@ -128,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1,
+      AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
         [Define if the vasnprintf implementation needs special code for
          the 'a' and 'A' directives.])
       AC_CHECK_FUNCS([nl_langinfo])
@@ -144,13 +143,28 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1,
+      AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1],
         [Define if the vasnprintf implementation needs special code for
          the 'F' directive.])
       ;;
   esac
 ])
 
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
+[
+  AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
+  case "$gl_cv_func_printf_directive_ls" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1],
+        [Define if the vasnprintf implementation needs special code for
+         the 'ls' directive.])
+      ;;
+  esac
+])
+
 # Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
 AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
 [
@@ -159,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1,
+      AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1],
         [Define if the vasnprintf implementation needs special code for the
          ' flag.])
       ;;
@@ -174,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1,
+      AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1],
         [Define if the vasnprintf implementation needs special code for the
          '-' flag.])
       ;;
@@ -189,7 +203,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1,
+      AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1],
         [Define if the vasnprintf implementation needs special code for the
          0 flag.])
       ;;
@@ -204,13 +218,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1,
+      AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1],
         [Define if the vasnprintf implementation needs special code for
          supporting large precisions without arbitrary bounds.])
-      AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
+      AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
         [Define if the vasnprintf implementation needs special code for
          'double' arguments.])
-      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
+      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
         [Define if the vasnprintf implementation needs special code for
          'long double' arguments.])
       ;;
@@ -226,13 +240,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
     *yes)
       ;;
     *)
-      AC_DEFINE([NEED_PRINTF_ENOMEM], 1,
+      AC_DEFINE([NEED_PRINTF_ENOMEM], [1],
         [Define if the vasnprintf implementation needs special code for
          surviving out-of-memory conditions.])
-      AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
+      AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
         [Define if the vasnprintf implementation needs special code for
          'double' arguments.])
-      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
+      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
         [Define if the vasnprintf implementation needs special code for
          'long double' arguments.])
       ;;
@@ -248,6 +262,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
   gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
   gl_PREREQ_VASNPRINTF_DIRECTIVE_A
   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