aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-03-21 01:02:58 +0100
committerYang Tse <yangsita@gmail.com>2012-03-21 01:02:58 +0100
commitdddcd3b0423efa3371c569ade15744669d745e40 (patch)
treeda6090f186979e337e5b32de608412aa39209ff7 /m4
parentc6825b7a6b5e8798bc861b3d280430e8149e7298 (diff)
curl-functions.m4: update detection logic of getaddrinfo() thread-safeness
Take in account that POSIX standard Issue 7 drops h_errno support. Now, we also consider getaddrinfo() to be thread-safe when (_POSIX_C_SOURCE >= 200809L) or (_XOPEN_SOURCE >= 700) independently of whether h_errno exists or not.
Diffstat (limited to 'm4')
-rw-r--r--m4/curl-functions.m420
1 files changed, 18 insertions, 2 deletions
diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4
index 419571a26..9fdc3bce1 100644
--- a/m4/curl-functions.m4
+++ b/m4/curl-functions.m4
@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -21,7 +21,7 @@
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 68
+# serial 69
dnl CURL_INCLUDES_ARPA_INET
@@ -2197,6 +2197,22 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
;;
esac
if test "$tst_tsafe_getaddrinfo" = "unknown"; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ ]],[[
+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
+ return 0;
+#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
+ return 0;
+#else
+ force compilation error
+#endif
+ ]])
+ ],[
+ tst_tsafe_getaddrinfo="yes"
+ ])
+ fi
+ if test "$tst_tsafe_getaddrinfo" = "unknown"; then
CURL_CHECK_DEF_CC([h_errno], [
$curl_includes_ws2tcpip
$curl_includes_sys_socket