diff options
author | Bruno Haible <bruno@clisp.org> | 2010-07-19 02:28:28 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-08-26 22:45:33 +0200 |
commit | 2c4321f6d6ab71a7bf97177ab685d67a24934fb5 (patch) | |
tree | 3adb9ef29d6f716675046aab8b5b8191efefcbd3 /m4/stdarg.m4 | |
parent | 20e165d6a6134f89399e090dfefa0d71e3bd500b (diff) | |
download | gnulib-2c4321f6d6ab71a7bf97177ab685d67a24934fb5.tar.gz |
Modernize AC_TRY_COMPILE invocations.
Diffstat (limited to 'm4/stdarg.m4')
-rw-r--r-- | m4/stdarg.m4 | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 index 5c87bd8b5f..8a62f2e844 100644 --- a/m4/stdarg.m4 +++ b/m4/stdarg.m4 @@ -1,4 +1,4 @@ -# stdarg.m4 serial 3 +# stdarg.m4 serial 4 dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -13,12 +13,16 @@ AC_DEFUN([gl_STDARG_H], NEXT_STDARG_H='<stdarg.h>'; AC_SUBST([NEXT_STDARG_H]) AC_MSG_CHECKING([for va_copy]) AC_CACHE_VAL([gl_cv_func_va_copy], [ - AC_TRY_COMPILE([#include <stdarg.h>], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdarg.h>]], + [[ #ifndef va_copy void (*func) (va_list, va_list) = va_copy; #endif -], - [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])]) + ]])], + [gl_cv_func_va_copy=yes], + [gl_cv_func_va_copy=no])]) AC_MSG_RESULT([$gl_cv_func_va_copy]) if test $gl_cv_func_va_copy = no; then dnl Provide a substitute. @@ -47,12 +51,16 @@ void (*func) (va_list, va_list) = va_copy; dnl Provide a substitute in <config.h>, either __va_copy or as a simple dnl assignment. gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ - AC_TRY_COMPILE([#include <stdarg.h>], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdarg.h>]], + [[ #ifndef __va_copy error, bail out #endif -], - [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])]) + ]])], + [gl_cv_func___va_copy=yes], + [gl_cv_func___va_copy=no])]) if test $gl_cv_func___va_copy = yes; then AC_DEFINE([va_copy], [__va_copy], [Define as a macro for copying va_list variables.]) |