| 1 |
dnl Copyright (c) 2007 The NetBSD Foundation, Inc. |
| 2 |
dnl All rights reserved. |
| 3 |
dnl |
| 4 |
dnl Redistribution and use in source and binary forms, with or without |
| 5 |
dnl modification, are permitted provided that the following conditions |
| 6 |
dnl are met: |
| 7 |
dnl 1. Redistributions of source code must retain the above copyright |
| 8 |
dnl notice, this list of conditions and the following disclaimer. |
| 9 |
dnl 2. Redistributions in binary form must reproduce the above copyright |
| 10 |
dnl notice, this list of conditions and the following disclaimer in the |
| 11 |
dnl documentation and/or other materials provided with the distribution. |
| 12 |
dnl |
| 13 |
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND |
| 14 |
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 15 |
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 16 |
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 17 |
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY |
| 18 |
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 19 |
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 20 |
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 21 |
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 22 |
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 23 |
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 24 |
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 |
|
| 26 |
AC_DEFUN([ATF_CHECK_IN_STD], [ |
| 27 |
AC_MSG_CHECKING(whether $1 is in std) |
| 28 |
AC_COMPILE_IFELSE( |
| 29 |
[AC_LANG_PROGRAM([$2], [$3 return 0;])], |
| 30 |
AC_MSG_RESULT(yes) |
| 31 |
AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_IN_STD], [1], |
| 32 |
[Define to 1 if $1 is in std]), |
| 33 |
AC_MSG_RESULT(no) |
| 34 |
) |
| 35 |
]) |
| 36 |
|
| 37 |
AC_DEFUN([ATF_CHECK_STD_VSNPRINTF], [ |
| 38 |
ATF_CHECK_IN_STD([vsnprintf], |
| 39 |
[#include <cstdarg> |
| 40 |
#include <cstdio>], |
| 41 |
[va_list ap; |
| 42 |
char* buf = NULL; |
| 43 |
const char* fmt = NULL; |
| 44 |
std::vsnprintf(buf, 0, fmt, ap);] |
| 45 |
) |
| 46 |
]) |