]> granicus.if.org Git - php/commitdiff
Experimental build support for VC10
authorKalle Sommer Nielsen <kalle@php.net>
Tue, 8 Sep 2009 01:50:40 +0000 (01:50 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Tue, 8 Sep 2009 01:50:40 +0000 (01:50 +0000)
 - Contains newly introduced compiler warning fixes
 - configure now picks up VC10

ext/sockets/sockets.c
ext/standard/flock_compat.h
main/php_network.h
main/streams/php_streams_int.h
win32/build/config.w32
win32/build/confutils.js
win32/php_stdint.h

index 337571181a6598e006144b5fb0afc45ea177004e..ed2a6d098446b8d9762ee7d26f4b2b2ea5682a73 100644 (file)
 # 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
index 1ffda52e9b92dfe6dd3c92e49d121ea0b738b4cb..da96e1d7b85a762265e04cb56254fef144ca5a0d 100644 (file)
@@ -42,9 +42,11 @@ 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)
+# ifndef EWOULDBLOCK
+#  define EWOULDBLOCK WSAEWOULDBLOCK
+# endif
+# define fsync _commit
+# define ftruncate(a, b) chsize(a, b)
 #endif /* defined(PHP_WIN32) */
 
 #if !HAVE_INET_ATON
index aafd0a2a67ad0824eb47596e6a971e9c87f96f0e..d8e34c402703f83e2ea8a448354259c86336cdba 100644 (file)
 #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
index 59e2036f0c711265b991f21d0cf9888bccac3140..c182e8278cbb6da52a3be66f43ed8a5c48cf4ff8 100644 (file)
@@ -48,7 +48,7 @@
 
 #define CHUNK_SIZE     8192
 
-#ifdef PHP_WIN32
+#if defined(PHP_WIN32) && !defined(EWOULDBLOCK)
 #define EWOULDBLOCK WSAEWOULDBLOCK
 #endif
 
index 1f8bc3ce3a868219794ecf639858f8561cf2e2cd..8dab2bf9c43f2350fe76315179d0c8f773028d8c 100644 (file)
@@ -15,8 +15,10 @@ if (!CL) {
 // 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]);
@@ -147,7 +149,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') {
                if(PHP_MP == 'auto' || PHP_MP == 'no') {
                         ADD_FLAG('CFLAGS', ' /MP ');
index 44c040bee9ed5f8f275dba5661fe7bac1a94005b..82886d725f8f9fc4973f1c60017922293bd2e5eb 100644 (file)
@@ -41,6 +41,7 @@ VC_VERSIONS[1300] = 'MSVC7 (Visual C++ 2002)';
 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
@@ -48,6 +49,7 @@ VC_VERSIONS_SHORT[1300] = 'VC7';
 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
index d3adcc29230edc71afcdff49ba48aa12af8e31e3..7c69d8ed0c371a8890ad6ee78146f6719cce2691 100644 (file)
@@ -264,7 +264,13 @@ 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; }
+// 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 ]