# include "php_sockets.h"
# include "win32/sockets.h"
# define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET)
-# define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-# define ECONNRESET WSAECONNRESET
+# ifndef EPROTONOSUPPORT
+# define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+# endif
+# ifndef ECONNRESET
+# define ECONNRESET WSAECONNRESET
+# endif
# ifdef errno
# undef errno
# endif
#define PHP_LOCK_NB 4
#ifdef PHP_WIN32
-#define EWOULDBLOCK WSAEWOULDBLOCK
-# define fsync _commit
-# define ftruncate(a, b) chsize(a, b)
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK WSAEWOULDBLOCK
+# endif
+# define fsync _commit
+# define ftruncate(a, b) chsize(a, b)
#endif /* defined(PHP_WIN32) */
#if !HAVE_INET_ATON
#endif
#ifdef PHP_WIN32
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define EINPROGRESS WSAEWOULDBLOCK
-# define fsync _commit
-# define ftruncate(a, b) chsize(a, b)
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK WSAEWOULDBLOCK
+# endif
+# ifndef EINPROGRESS
+# define EINPROGRESS WSAEWOULDBLOCK
+#endif
+# define fsync _commit
+# define ftruncate(a, b) chsize(a, b)
#endif /* defined(PHP_WIN32) */
#ifndef EWOULDBLOCK
#define CHUNK_SIZE 8192
-#ifdef PHP_WIN32
+#if defined(PHP_WIN32) && !defined(EWOULDBLOCK)
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
// 1310 is vs.net 2003
// 1400 is vs.net 2005
// 1500 is vs.net 2008
+// 1600 is vs.net 2010
// Which version of the compiler do we have?
VCVERS = probe_binary(CL).substr(0, 5).replace('.', '');
+STDOUT.WriteLine(VCVERS);
STDOUT.WriteLine(" Detected compiler " + VC_VERSIONS[VCVERS]);
AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version");
DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]);
}
}
-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') {
if(PHP_MP == 'auto' || PHP_MP == 'no') {
ADD_FLAG('CFLAGS', ' /MP ');
VC_VERSIONS[1310] = 'MSVC7.1 (Visual C++ 2003)';\r
VC_VERSIONS[1400] = 'MSVC8 (Visual C++ 2005)';\r
VC_VERSIONS[1500] = 'MSVC9 (Visual C++ 2008)';\r
+VC_VERSIONS[1600] = 'MSVC10 (Visual C++ 2010)';\r
\r
var VC_VERSIONS_SHORT = new Array();\r
VC_VERSIONS_SHORT[1200] = 'VC6';\r
VC_VERSIONS_SHORT[1310] = 'VC7.1';\r
VC_VERSIONS_SHORT[1400] = 'VC8';\r
VC_VERSIONS_SHORT[1500] = 'VC9';\r
+VC_VERSIONS_SHORT[1600] = 'VC10';\r
\r
if (PROGRAM_FILES == null) {\r
PROGRAM_FILES = "C:\\Program Files";\r
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
-static __inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; }
+// In VC10+, llabs is an intrinsic function, so don't define it
+#if _MSC_VER < 1600
+static __inline int64_t llabs( int64_t i )
+{
+ return i >= 0 ? i : -i;
+}
+#endif
#endif // __STDC_CONSTANT_MACROS ]