Fix formula.
[gnulib.git] / m4 / vasnprintf.m4
index 4ae3d10..5aa05bc 100644 (file)
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 8
+# vasnprintf.m4 serial 9
 dnl Copyright (C) 2002-2004, 2006-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,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_VASNPRINTF],
 [
   AC_REQUIRE([gl_EOVERFLOW])
-  AC_CHECK_FUNCS([vasnprintf])
+  AC_CHECK_FUNCS_ONCE([vasnprintf])
   if test $ac_cv_func_vasnprintf = no; then
     gl_REPLACE_VASNPRINTF
   fi
@@ -15,10 +15,15 @@ AC_DEFUN([gl_FUNC_VASNPRINTF],
 
 AC_DEFUN([gl_REPLACE_VASNPRINTF],
 [
+  AC_CHECK_FUNCS_ONCE([vasnprintf])
   AC_LIBOBJ([vasnprintf])
   AC_LIBOBJ([printf-args])
   AC_LIBOBJ([printf-parse])
   AC_LIBOBJ([asnprintf])
+  if test $ac_cv_func_vasnprintf = yes; then
+    AC_DEFINE([REPLACE_VASNPRINTF], 1,
+      [Define if vasnprintf exists but is overridden by gnulib.])
+  fi
   gl_PREREQ_PRINTF_ARGS
   gl_PREREQ_PRINTF_PARSE
   gl_PREREQ_VASNPRINTF