]> granicus.if.org Git - php/commitdiff
fix constants availability
authorAnatol Belski <ab@php.net>
Fri, 29 Apr 2016 09:34:54 +0000 (11:34 +0200)
committerAnatol Belski <ab@php.net>
Fri, 29 Apr 2016 09:37:19 +0000 (11:37 +0200)
The issue here is that winsock2 defines IP protocols as an enum,
so the preprocessor won't catch it. However all the items related
are available as of winxp (see ws2def.h), so it's safe just to have.

ext/standard/file.c

index 535fc44f3fb469cfe2542f15bd58e950c5fec25d..eef1287b0f873d772b6678179bc8a9c3f1903e48 100644 (file)
@@ -262,19 +262,19 @@ PHP_MINIT_FUNCTION(file)
        REGISTER_LONG_CONSTANT("STREAM_IPPROTO_IP", IPPROTO_IP, CONST_CS|CONST_PERSISTENT);
 #endif
 
-#ifdef IPPROTO_TCP
+#if defined(IPPROTO_TCP) || defined(PHP_WIN32)
        REGISTER_LONG_CONSTANT("STREAM_IPPROTO_TCP", IPPROTO_TCP, CONST_CS|CONST_PERSISTENT);
 #endif
 
-#ifdef IPPROTO_UDP
+#if defined(IPPROTO_UDP) || defined(PHP_WIN32)
        REGISTER_LONG_CONSTANT("STREAM_IPPROTO_UDP", IPPROTO_UDP, CONST_CS|CONST_PERSISTENT);
 #endif
 
-#ifdef IPPROTO_ICMP
+#if defined(IPPROTO_ICMP) || defined(PHP_WIN32)
        REGISTER_LONG_CONSTANT("STREAM_IPPROTO_ICMP", IPPROTO_ICMP, CONST_CS|CONST_PERSISTENT);
 #endif
 
-#ifdef IPPROTO_RAW
+#if defined(IPPROTO_RAW) || defined(PHP_WIN32)
        REGISTER_LONG_CONSTANT("STREAM_IPPROTO_RAW", IPPROTO_RAW, CONST_CS|CONST_PERSISTENT);
 #endif