From 1063c8346bd319ac3ca5fd6531442ff8fc8ec66c Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Thu, 3 Dec 2009 11:50:32 +0000 Subject: [PATCH] MFT: VC10 build support --- ext/sockets/sockets.c | 6 ++++++ ext/standard/flock_compat.h | 9 ++++++--- main/php_network.h | 14 ++++++++++---- main/streams/php_streams_int.h | 5 ++++- win32/build/config.w32 | 2 +- win32/php_stdint.h | 7 ++++++- 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 0b635f399c5..c47d2894e01 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -41,6 +41,12 @@ # include "php_sockets.h" # include "win32/sockets.h" # define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET) +# ifdef EPROTONOSUPPORT +# undef EPROTONOSUPPORT +# endif +# ifdef ECONNRESET +# undef ECONNRESET +# endif # define EPROTONOSUPPORT WSAEPROTONOSUPPORT # define ECONNRESET WSAECONNRESET # ifdef errno diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index a0c4054ff6d..29a9c033cd2 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -42,9 +42,12 @@ PHPAPI int flock(int fd, int operation); #define PHP_LOCK_NB 4 #ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -# define fsync _commit -# define ftruncate(a, b) chsize(a, b) +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) #endif /* defined(PHP_WIN32) */ #if !HAVE_INET_ATON diff --git a/main/php_network.h b/main/php_network.h index 9f552f352b5..1109bfbd353 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -34,10 +34,16 @@ #endif #ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEWOULDBLOCK -# define fsync _commit -# define ftruncate(a, b) chsize(a, b) +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# ifdef EINPROGRESS +# undef EINPROGRESS +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# define EINPROGRESS WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) #endif /* defined(PHP_WIN32) */ #ifndef EWOULDBLOCK diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index 9dc4496a3e3..3edb5efbc84 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -49,7 +49,10 @@ #define CHUNK_SIZE 8192 #ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK #endif #ifndef S_ISREG diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 8861d49b787..c52ce017374 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -148,7 +148,7 @@ if (VCVERS >= 1400) { } } -ARG_WITH('mp', 'Tell VC9 use up to [n,auto,disable] processes for compilation', 'auto'); +ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto'); if (VCVERS >= 1500 && PHP_MP != 'disable') { // no from disable-all if(PHP_MP == 'auto' || PHP_MP == 'no') { diff --git a/win32/php_stdint.h b/win32/php_stdint.h index 6eb8ce48f0a..5df1df4777e 100644 --- a/win32/php_stdint.h +++ b/win32/php_stdint.h @@ -238,7 +238,12 @@ typedef uint64_t uintmax_t; #define INTMAX_C INT64_C #define UINTMAX_C UINT64_C -static __inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; } +#if _MSC_VER < 1600 +static __inline int64_t llabs(int64_t i) +{ + return i >= 0 ? i: -i; +} +#endif #endif // __STDC_CONSTANT_MACROS ]