com php-src: fix constants availability: ext/standard/file.c

From: Date: Fri, 29 Apr 2016 09:37:19 +0000
Subject: com php-src: fix constants availability: ext/standard/file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91942@lists.php.net to get a copy of this message
Commit: 9db8cefa3cfccb2f116e2829f670bae300f8ad11 Author: Anatol Belski <ab@php.net> Fri, 29 Apr 2016 11:34:54 +0200 Parents: 12f826d7df6eceb2fe985fc0dd76b5393566e059 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9db8cefa3cfccb2f116e2829f670bae300f8ad11 Log: 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. Changed paths: M ext/standard/file.c Diff: diff --git a/ext/standard/file.c b/ext/standard/file.c index 535fc44..eef1287 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

« previous php.cvs (#91942) next »