@@ -87,7 +87,7 @@ const struct in6_addr in6addr_any = {0}; /* IN6ADDR_ANY_INIT; */
87
87
# define PHP_TIMEOUT_ERROR_VALUE ETIMEDOUT
88
88
#endif
89
89
90
- #if HAVE_GETADDRINFO
90
+ #ifdef HAVE_GETADDRINFO
91
91
#ifdef HAVE_GAI_STRERROR
92
92
# define PHP_GAI_STRERROR (x ) (gai_strerror(x))
93
93
#else
@@ -150,7 +150,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
150
150
{
151
151
struct sockaddr * * sap ;
152
152
int n ;
153
- #if HAVE_GETADDRINFO
153
+ #ifdef HAVE_GETADDRINFO
154
154
# ifdef HAVE_IPV6
155
155
static int ipv6_borked = -1 ; /* the way this is used *is* thread safe */
156
156
# endif
@@ -163,7 +163,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
163
163
if (host == NULL ) {
164
164
return 0 ;
165
165
}
166
- #if HAVE_GETADDRINFO
166
+ #ifdef HAVE_GETADDRINFO
167
167
memset (& hints , '\0' , sizeof (hints ));
168
168
169
169
hints .ai_family = AF_INET ; /* default to regular inet (see below) */
@@ -422,7 +422,7 @@ php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned po
422
422
sa = * sal ;
423
423
424
424
switch (sa -> sa_family ) {
425
- #if HAVE_GETADDRINFO && HAVE_IPV6
425
+ #if defined( HAVE_GETADDRINFO ) && defined( HAVE_IPV6 )
426
426
case AF_INET6 :
427
427
((struct sockaddr_in6 * )sa )-> sin6_port = htons (port );
428
428
socklen = sizeof (struct sockaddr_in6 );
@@ -566,7 +566,7 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_lo
566
566
567
567
/* copy the details from the first item */
568
568
switch ((* psal )-> sa_family ) {
569
- #if HAVE_GETADDRINFO && HAVE_IPV6
569
+ #if defined( HAVE_GETADDRINFO ) && defined( HAVE_IPV6 )
570
570
case AF_INET6 :
571
571
* in6 = * * (struct sockaddr_in6 * * )psal ;
572
572
in6 -> sin6_port = htons (port );
@@ -802,7 +802,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
802
802
sa = * sal ;
803
803
804
804
switch (sa -> sa_family ) {
805
- #if HAVE_GETADDRINFO && HAVE_IPV6
805
+ #if defined( HAVE_GETADDRINFO ) && defined( HAVE_IPV6 )
806
806
case AF_INET6 :
807
807
if (!bindto || strchr (bindto , ':' )) {
808
808
((struct sockaddr_in6 * )sa )-> sin6_port = htons (port );
0 commit comments