#45456 (_WIN32_WINNT) and fix VC9, zend/
| From: | Pierre Joye | Date: | Sat, 12 Jul 2008 23:52:17 +0000 |
| Subject: | #45456 (_WIN32_WINNT) and fix VC9, zend/ | ||
| Groups: | php.internals.win | ||
| Request: | Send a blank email to internals-win+get-45@lists.php.net to get a copy of this message | ||
hi!
The win32_winnt_patch.txt fixes the issue describe in #45456. It
defines _WIN32_WINNT only in main/config.w32.h which is include
whenever it is required. We may add a note somewhere to ask to do not
override this setting locally (in an extension or in the engine) but
to use this file instead. I can commit part of it myself but it would
be nicer to have a single commit (Zend and php-src) for this fix.
The second patch fixes the build with VC9 with the 2k8/Vista SDK (6.1
and maybe 6.0A too).
Cheers,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org
Index: TSRM/readdir.h =================================================================== RCS file: /repository/TSRM/readdir.h,v retrieving revision 1.1.34.1 diff -u -r1.1.34.1 readdir.h --- TSRM/readdir.h 10 Nov 2006 11:20:47 -0000 1.1.34.1 +++ TSRM/readdir.h 12 Jul 2008 16:03:04 -0000 @@ -7,8 +7,7 @@ * on Windows 95/NT. */ -#define _WIN32_WINNT 0x0400 - +#include <../main/config.w32.h> #include <windows.h> #include <io.h> Index: Zend/zend_alloc.c =================================================================== RCS file: /repository/ZendEngine2/zend_alloc.c,v retrieving revision 1.144.2.3.2.43.2.12 diff -u -r1.144.2.3.2.43.2.12 zend_alloc.c --- Zend/zend_alloc.c 11 May 2008 11:46:44 -0000 1.144.2.3.2.43.2.12 +++ Zend/zend_alloc.c 12 Jul 2008 23:37:10 -0000 @@ -33,7 +33,7 @@ #endif #ifdef ZEND_WIN32 -# define _WIN32_WINNT 0x0400 +# include <../main/config.w32.h> # include <wincrypt.h> # include <process.h> #endif Index: win32/build/config.w32.h.in =================================================================== RCS file: /repository/php-src/win32/build/config.w32.h.in,v retrieving revision 1.7.2.4.2.3.2.1 diff -u -r1.7.2.4.2.3.2.1 config.w32.h.in --- win32/build/config.w32.h.in 18 Mar 2008 21:14:28 -0000 1.7.2.4.2.3.2.1 +++ win32/build/config.w32.h.in 12 Jul 2008 17:00:21 -0000 @@ -3,6 +3,10 @@ $Id: config.w32.h.in,v 1.7.2.4.2.3.2.1 2008/03/18 21:14:28 rasmus Exp $ */ +/* Define the minimum supported version */ +#define _WIN32_WINNT 0x500 +#define NTDDI_VERSION _WIN32_WIN2k + /* Default PHP / PEAR directories */ #define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" #define CONFIGURATION_FILE_PATH "php.ini" Index: win32/readdir.h =================================================================== RCS file: /repository/php-src/win32/readdir.h,v retrieving revision 1.8.6.2 diff -u -r1.8.6.2 readdir.h --- win32/readdir.h 1 Dec 2006 20:17:50 -0000 1.8.6.2 +++ win32/readdir.h 12 Jul 2008 16:03:53 -0000 @@ -7,7 +7,7 @@ * on Windows 95/NT. */ -#define _WIN32_WINNT 0x0400 +#include <../main/config.w32.h> #include <windows.h> Index: win32/time.c =================================================================== RCS file: /repository/php-src/win32/time.c,v retrieving revision 1.10 diff -u -r1.10 time.c --- win32/time.c 29 Jul 2004 02:59:43 -0000 1.10 +++ win32/time.c 12 Jul 2008 16:31:24 -0000 @@ -23,8 +23,8 @@ /* Include stuff ************************************************************ */ /* this allows the use of the WaitableTimer functions. - * For win98 and later */ -#define _WIN32_WINNT 0x400 + * For win98 and later (_WIN32_WINNT) */ +#include <../main/config.w32.h> #include "time.h" #include "unistd.h" Index: zend_config.w32.h =================================================================== RCS file: /repository/ZendEngine2/zend_config.w32.h,v retrieving revision 1.39.2.2.2.2.2.1 diff -u -r1.39.2.2.2.2.2.1 zend_config.w32.h --- zend_config.w32.h 31 Dec 2007 07:17:04 -0000 1.39.2.2.2.2.2.1 +++ zend_config.w32.h 12 Jul 2008 17:25:45 -0000 @@ -48,7 +48,9 @@ #define istdiostream stdiostream #define snprintf _snprintf -#define vsnprintf _vsnprintf +#if _MSC_VER != 1500 +# define vsnprintf _vsnprintf +#endif #define strcasecmp(s1, s2) stricmp(s1, s2) #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n) #define zend_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF))
Index: TSRM/readdir.h =================================================================== RCS file: /repository/TSRM/readdir.h,v retrieving revision 1.1.34.1 diff -u -r1.1.34.1 readdir.h --- TSRM/readdir.h 10 Nov 2006 11:20:47 -0000 1.1.34.1 +++ TSRM/readdir.h 12 Jul 2008 16:03:04 -0000 @@ -7,8 +7,7 @@ * on Windows 95/NT. */ -#define _WIN32_WINNT 0x0400 - +#include <../main/config.w32.h> #include <windows.h> #include <io.h> Index: Zend/zend_alloc.c =================================================================== RCS file: /repository/ZendEngine2/zend_alloc.c,v retrieving revision 1.144.2.3.2.43.2.12 diff -u -r1.144.2.3.2.43.2.12 zend_alloc.c --- Zend/zend_alloc.c 11 May 2008 11:46:44 -0000 1.144.2.3.2.43.2.12 +++ Zend/zend_alloc.c 12 Jul 2008 23:37:10 -0000 @@ -33,7 +33,7 @@ #endif #ifdef ZEND_WIN32 -# define _WIN32_WINNT 0x0400 +# include <../main/config.w32.h> # include <wincrypt.h> # include <process.h> #endif Index: win32/build/config.w32.h.in =================================================================== RCS file: /repository/php-src/win32/build/config.w32.h.in,v retrieving revision 1.7.2.4.2.3.2.1 diff -u -r1.7.2.4.2.3.2.1 config.w32.h.in --- win32/build/config.w32.h.in 18 Mar 2008 21:14:28 -0000 1.7.2.4.2.3.2.1 +++ win32/build/config.w32.h.in 12 Jul 2008 17:00:21 -0000 @@ -3,6 +3,10 @@ $Id: config.w32.h.in,v 1.7.2.4.2.3.2.1 2008/03/18 21:14:28 rasmus Exp $ */ +/* Define the minimum supported version */ +#define _WIN32_WINNT 0x500 +#define NTDDI_VERSION _WIN32_WIN2k + /* Default PHP / PEAR directories */ #define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" #define CONFIGURATION_FILE_PATH "php.ini" Index: win32/readdir.h =================================================================== RCS file: /repository/php-src/win32/readdir.h,v retrieving revision 1.8.6.2 diff -u -r1.8.6.2 readdir.h --- win32/readdir.h 1 Dec 2006 20:17:50 -0000 1.8.6.2 +++ win32/readdir.h 12 Jul 2008 16:03:53 -0000 @@ -7,7 +7,7 @@ * on Windows 95/NT. */ -#define _WIN32_WINNT 0x0400 +#include <../main/config.w32.h> #include <windows.h> Index: win32/time.c =================================================================== RCS file: /repository/php-src/win32/time.c,v retrieving revision 1.10 diff -u -r1.10 time.c --- win32/time.c 29 Jul 2004 02:59:43 -0000 1.10 +++ win32/time.c 12 Jul 2008 16:31:24 -0000 @@ -23,8 +23,8 @@ /* Include stuff ************************************************************ */ /* this allows the use of the WaitableTimer functions. - * For win98 and later */ -#define _WIN32_WINNT 0x400 + * For win98 and later (_WIN32_WINNT) */ +#include <../main/config.w32.h> #include "time.h" #include "unistd.h" Index: zend_config.w32.h =================================================================== RCS file: /repository/ZendEngine2/zend_config.w32.h,v retrieving revision 1.39.2.2.2.2.2.1 diff -u -r1.39.2.2.2.2.2.1 zend_config.w32.h --- zend_config.w32.h 31 Dec 2007 07:17:04 -0000 1.39.2.2.2.2.2.1 +++ zend_config.w32.h 12 Jul 2008 17:25:45 -0000 @@ -48,7 +48,9 @@ #define istdiostream stdiostream #define snprintf _snprintf -#define vsnprintf _vsnprintf +#if _MSC_VER != 1500 +# define vsnprintf _vsnprintf +#endif #define strcasecmp(s1, s2) stricmp(s1, s2) #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n) #define zend_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF))