1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
$NetBSD: patch-ac,v 1.5 2007/11/08 03:56:58 obache Exp $
--- upnp/src/genlib/net/uri/uri.c.orig 2007-08-06 01:21:23.000000000 +0000
+++ upnp/src/genlib/net/uri/uri.c
@@ -625,9 +625,9 @@ parse_hostport( const char *in,
//call gethostbyname_r (reentrant form of gethostbyname)
// TODO: Use autoconf to discover this rather than the
// platform-specific stuff below
-#if defined(WIN32) || defined(__CYGWIN__)
+#if defined(WIN32) || defined(__CYGWIN__) || defined(_AIX50) || defined(__upux11)
h = gethostbyname(temp_host_name);
-#elif defined(SPARC_SOLARIS)
+#elif defined(sun) || defined(__sun) || defined(sgi) || defined(__sgi)
errCode = gethostbyname_r(
temp_host_name,
&h,
@@ -647,12 +647,17 @@ parse_hostport( const char *in,
if ( h == NULL ) {
errCode = 1;
}
-#elif defined(__linux__)
+#elif defined(__GLIBC__)
errCode = gethostbyname_r(
temp_host_name,
&h_buf,
temp_hostbyname_buff,
BUFFER_SIZE, &h, &errcode );
+#elif defined(__osf1__) || defined(__hpux) || defined(_AIX)
+ errCode = gethostbyname_r( temp_host_name,
+ &h_buf,
+ (struct hostent_data*)temp_hostbyname_buff);
+ h = &h_buf;
#else
{
struct addrinfo hints, *res, *res0;
|