summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Soria Parra <dsp@php.net>2011-07-15 15:25:24 +0000
committerDavid Soria Parra <dsp@php.net>2011-07-15 15:25:24 +0000
commitfa79f2f46ba83ea669184ff1976c98ff34b91d28 (patch)
tree898b21f0f951523a84d015075f109bde380a22c8
parent1bc1d3572f56050c7063b84c9011d3af145f0439 (diff)
downloadphp-git-fa79f2f46ba83ea669184ff1976c98ff34b91d28.tar.gz
Fix #55212. Only declare STREAM_PF_INET6 if PHP is compiled with IPv6 support
-rw-r--r--ext/standard/file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index bcac3c75eb..ddf7038840 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -236,10 +236,12 @@ PHP_MINIT_FUNCTION(file)
REGISTER_LONG_CONSTANT("STREAM_PF_INET", AF_INET, CONST_CS|CONST_PERSISTENT);
#endif
-#ifdef PF_INET6
+#if HAVE_IPV6
+# ifdef PF_INET6
REGISTER_LONG_CONSTANT("STREAM_PF_INET6", PF_INET6, CONST_CS|CONST_PERSISTENT);
-#elif defined(AF_INET6)
+# elif defined(AF_INET6)
REGISTER_LONG_CONSTANT("STREAM_PF_INET6", AF_INET6, CONST_CS|CONST_PERSISTENT);
+# endif
#endif
#ifdef PF_UNIX