summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Kalowsky <kalowsky@php.net>2001-12-27 15:42:05 +0000
committerDan Kalowsky <kalowsky@php.net>2001-12-27 15:42:05 +0000
commitb76eb3ae40d0ed9130dfb8b84a855fb94f06236c (patch)
treed0af960ae45c7b572915f4b89fd1621f19f035a4
parent3d89072c7e6396515c4edcaa133e40708c742c95 (diff)
downloadphp-git-b76eb3ae40d0ed9130dfb8b84a855fb94f06236c.tar.gz
Making PHP compile again on MacOSX 10.1
# 10.1 does not have inet_pton support yet it seems so disabling it.
-rw-r--r--ext/standard/dns.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 05c6e01270..d677755399 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -82,7 +82,9 @@ PHP_FUNCTION(gethostbyaddr)
addr = php_gethostbyaddr(Z_STRVAL_PP(arg));
if(addr == NULL) {
-#if HAVE_IPV6
+#if HAVE_IPV6 && !defined(__MacOSX__)
+/* MacOSX at this time has support for IPv6, but not inet_pton()
+ * so disabling IPv6 until further notice. MacOSX 10.1.2 (kalowsky) */
php_error(E_WARNING, "Address is not a valid IPv4 or IPv6 address");
#else
php_error(E_WARNING, "Address is not in a.b.c.d form");
@@ -98,13 +100,17 @@ PHP_FUNCTION(gethostbyaddr)
*/
static char *php_gethostbyaddr(char *ip)
{
-#if HAVE_IPV6
+#if HAVE_IPV6 && !defined(__MacOSX__)
+/* MacOSX at this time has support for IPv6, but not inet_pton()
+ * so disabling IPv6 until further notice. MacOSX 10.1.2 (kalowsky) */
struct in6_addr addr6;
#endif
struct in_addr addr;
struct hostent *hp;
-#if HAVE_IPV6
+#if HAVE_IPV6 && !defined(__MacOSX__)
+/* MacOSX at this time has support for IPv6, but not inet_pton()
+ * so disabling IPv6 until further notice. MacOSX 10.1.2 (kalowsky) */
if (inet_pton(AF_INET6, ip, &addr6)) {
hp = gethostbyaddr((char *) &addr6, sizeof(addr6), AF_INET6);
} else if (inet_pton(AF_INET, ip, &addr)) {