Test for _snprintf (missing since 2003-11-16).
authorBruno Haible <bruno@clisp.org>
Sun, 10 Jun 2007 15:05:31 +0000 (15:05 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 10 Jun 2007 15:05:31 +0000 (15:05 +0000)
ChangeLog
m4/vasnprintf.m4

index 74e7f1d..c3782e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-10  Bruno Haible  <bruno@clisp.org>
+
+       * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF): Check for _snprintf
+       declaration.
+
 2007-06-10  Karl Berry  <karl@gnu.org>
 
        * config/srclist.txt: remove gettext entries, Bruno prefers
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'