Test for _snprintf (missing since 2003-11-16).
[gnulib.git] / m4 / vasnprintf.m4
index 7d676c2..accee4b 100644 (file)
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 18
+# vasnprintf.m4 serial 19
 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,
@@ -57,6 +57,9 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_CHECK_FUNCS(snprintf wcslen)
+  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>])
 ])
 
 # Extra prerequisites of lib/vasnprintf.c for supporting 'long double'