aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Ian Lynagh <igloo@earth.li>2008-07-03 19:06:03 +0000
committerGravatar Ian Lynagh <igloo@earth.li>2008-07-03 19:06:03 +0000
commit3c5861c340cb45cf626f61e022d0aa2805f16569 (patch)
tree970791c9336c2dddc3d181b057b7603ae20d95f9 /configure.ac
parent4981740456c7219251e9f059a509bc0e5cdf0930 (diff)
Allow C's unsetenv to return either void or int
Fixes, and patch from donn in, trac #2352.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
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(<, >)<void[ ]+unsetenv>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,