From 9db8cefa3cfccb2f116e2829f670bae300f8ad11 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 29 Apr 2016 11:34:54 +0200 Subject: [PATCH] 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. --- ext/standard/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.50.1