changeset 8965:8b25e939df30

Test for _snprintf (missing since 2003-11-16).
author Bruno Haible <bruno@clisp.org>
date Sun, 10 Jun 2007 15:05:31 +0000
parents 94bf81845cdc
children cbc204793cf7
files ChangeLog m4/vasnprintf.m4
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -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_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'