From: Anatol Belski Date: Fri, 29 Apr 2016 09:34:54 +0000 (+0200) Subject: fix constants availability X-Git-Tag: php-7.1.0alpha1~237^2~3^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9db8cefa3cfccb2f116e2829f670bae300f8ad11;p=php fix constants availability 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. --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 535fc44f3f..eef1287b0f 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -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