cURL / Mailing Lists / curl-users / Single Mail

curl-users

CURL_CHECK_GETHOSTBYNAME_R patch

From: Albert Chin <curl_at_thewrittenword.com>
Date: Thu, 31 Jan 2002 01:11:46 -0600

Forgot one case. On HP-UX 11.00, gethostbyname_r() is properly defined
if -D_REENTRANT is used. Without it, the compiler still accepts the
function prototype but gives a warning about hostent_data going out of
scope. This is because struct hostent_data is not declared. So, we
force an error by trying to set a variable to the struct.

-- 
albert chin (china_at_thewrittenword.com)
-- snip snip
--- acinclude.m4.orig	Thu Jan 31 01:07:18 2002
+++ acinclude.m4	Thu Jan 31 01:08:09 2002
@@ -377,6 +377,7 @@
 
 int
 gethostbyname_r(const char *, struct hostent *, struct hostent_data *);],[
+struct hostent_data data;
 gethostbyname_r(NULL, NULL, NULL);],[
       AC_MSG_RESULT(yes)
       AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
@@ -394,6 +395,7 @@
 
 int
 gethostbyname_r(const char *,struct hostent *, struct hostent_data *);],[
+struct hostent_data data;
 gethostbyname_r(NULL, NULL, NULL);],[
 	AC_MSG_RESULT(yes)
 	AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
Received on 2002-01-31