Modernize AC_TRY_COMPILE invocations.
[gnulib.git] / m4 / setenv.m4
index 58f6d13..5a800d3 100644 (file)
@@ -1,4 +1,4 @@
-# setenv.m4 serial 16
+# setenv.m4 serial 17
 dnl Copyright (C) 2001-2004, 2006-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,
@@ -53,7 +53,10 @@ AC_DEFUN([gl_FUNC_UNSETENV],
   else
     dnl Some BSDs return void, failing to do error checking.
     AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
-      [AC_TRY_COMPILE([#include <stdlib.h>
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[
+#include <stdlib.h>
 extern
 #ifdef __cplusplus
 "C"
@@ -63,7 +66,10 @@ int unsetenv (const char *name);
 #else
 int unsetenv();
 #endif
-], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')])
+            ]],
+            [[]])],
+         [gt_cv_func_unsetenv_ret='int'],
+         [gt_cv_func_unsetenv_ret='void'])])
     if test $gt_cv_func_unsetenv_ret = 'void'; then
       AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
        instead of int.])