Skip to content

Commit

Permalink
MFT: VC10 build support
Browse files Browse the repository at this point in the history
  • Loading branch information
KalleZ committed Dec 3, 2009
1 parent 0f0f5f2 commit 1063c83
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
6 changes: 6 additions & 0 deletions ext/sockets/sockets.c
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions ext/standard/flock_compat.h
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions main/php_network.h
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion main/streams/php_streams_int.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion win32/build/config.w32
Expand Up @@ -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') {
Expand Down
7 changes: 6 additions & 1 deletion win32/php_stdint.h
Expand Up @@ -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 ]

Expand Down

0 comments on commit 1063c83

Please sign in to comment.