From 3c5861c340cb45cf626f61e022d0aa2805f16569 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 3 Jul 2008 19:06:03 +0000 Subject: Allow C's unsetenv to return either void or int Fixes, and patch from donn in, trac #2352. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 97a3f2f..5283a55 100644 --- a/configure.ac +++ b/configure.ac @@ -75,6 +75,19 @@ case "$cv_func_usleep_return_type" in ;; esac +### POSIX.1003.1 unsetenv returns 0 or -1 (EINVAL), but older implementations +### in common use return void. +AC_CACHE_CHECK([return type of unsetenv], cv_func_unsetenv_return_type, + [AC_EGREP_HEADER(changequote(<, >)changequote([, ]), + /usr/include/stdlib.h, + [cv_func_unsetenv_return_type=void], + [cv_func_unsetenv_return_type=int])]) +case "$cv_func_unsetenv_return_type" in + "void" ) + AC_DEFINE([UNSETENV_RETURNS_VOID], [1], [Define if stdlib.h declares unsetenv to return void.]) + ;; +esac + dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h) AC_EGREP_CPP(yes, -- cgit v1.2.3