Skip to content

Commit 1063c83

Browse files
committed
MFT: VC10 build support
1 parent 0f0f5f2 commit 1063c83

File tree

6 files changed

+33
-10
lines changed

6 files changed

+33
-10
lines changed

ext/sockets/sockets.c

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
# include "php_sockets.h"
4242
# include "win32/sockets.h"
4343
# define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET)
44+
# ifdef EPROTONOSUPPORT
45+
# undef EPROTONOSUPPORT
46+
# endif
47+
# ifdef ECONNRESET
48+
# undef ECONNRESET
49+
# endif
4450
# define EPROTONOSUPPORT WSAEPROTONOSUPPORT
4551
# define ECONNRESET WSAECONNRESET
4652
# ifdef errno

ext/standard/flock_compat.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ PHPAPI int flock(int fd, int operation);
4242
#define PHP_LOCK_NB 4
4343

4444
#ifdef PHP_WIN32
45-
#define EWOULDBLOCK WSAEWOULDBLOCK
46-
# define fsync _commit
47-
# define ftruncate(a, b) chsize(a, b)
45+
# ifdef EWOULDBLOCK
46+
# undef EWOULDBLOCK
47+
# endif
48+
# define EWOULDBLOCK WSAEWOULDBLOCK
49+
# define fsync _commit
50+
# define ftruncate(a, b) chsize(a, b)
4851
#endif /* defined(PHP_WIN32) */
4952

5053
#if !HAVE_INET_ATON

main/php_network.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@
3434
#endif
3535

3636
#ifdef PHP_WIN32
37-
#define EWOULDBLOCK WSAEWOULDBLOCK
38-
#define EINPROGRESS WSAEWOULDBLOCK
39-
# define fsync _commit
40-
# define ftruncate(a, b) chsize(a, b)
37+
# ifdef EWOULDBLOCK
38+
# undef EWOULDBLOCK
39+
# endif
40+
# ifdef EINPROGRESS
41+
# undef EINPROGRESS
42+
# endif
43+
# define EWOULDBLOCK WSAEWOULDBLOCK
44+
# define EINPROGRESS WSAEWOULDBLOCK
45+
# define fsync _commit
46+
# define ftruncate(a, b) chsize(a, b)
4147
#endif /* defined(PHP_WIN32) */
4248

4349
#ifndef EWOULDBLOCK

main/streams/php_streams_int.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
#define CHUNK_SIZE 8192
5050

5151
#ifdef PHP_WIN32
52-
#define EWOULDBLOCK WSAEWOULDBLOCK
52+
# ifdef EWOULDBLOCK
53+
# undef EWOULDBLOCK
54+
# endif
55+
# define EWOULDBLOCK WSAEWOULDBLOCK
5356
#endif
5457

5558
#ifndef S_ISREG

win32/build/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ if (VCVERS >= 1400) {
148148
}
149149
}
150150

151-
ARG_WITH('mp', 'Tell VC9 use up to [n,auto,disable] processes for compilation', 'auto');
151+
ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto');
152152
if (VCVERS >= 1500 && PHP_MP != 'disable') {
153153
// no from disable-all
154154
if(PHP_MP == 'auto' || PHP_MP == 'no') {

win32/php_stdint.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ typedef uint64_t uintmax_t;
238238
#define INTMAX_C INT64_C
239239
#define UINTMAX_C UINT64_C
240240

241-
static __inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; }
241+
#if _MSC_VER < 1600
242+
static __inline int64_t llabs(int64_t i)
243+
{
244+
return i >= 0 ? i: -i;
245+
}
246+
#endif
242247

243248
#endif // __STDC_CONSTANT_MACROS ]
244249

0 commit comments

Comments
 (0)