%{
-#if WIN32|WINNT
+#if ZEND_WIN32
#include <winsock.h>
#include <io.h>
#endif
# ifdef HAVE_STDIOSTREAM_H
# include <stdiostream.h>
# endif
-# if WIN32||WINNT
+# if ZEND_WIN32
# include <strstrea.h>
# else
# include <strstream.h>
/* redefine YY_INPUT to handle urls for win32*/
-#if 0 /*WIN32|WINNT*/
+#if 0 /*ZEND_WIN32*/
#define YY_INPUT(buf,result,max_size) \
if ( yyin->_tmpfname != "url" ){ \
if ( yy_current_buffer->yy_is_interactive ) \
* general definitions
*/
-#if (defined(WINNT) && WINNT) || (defined(WIN32) && WIN32)
+#define ZEND_WIN32 ((defined(WINNT) && WINNT) || (defined(WIN32) && WIN32))
+
+#if ZEND_WIN32
# include "zend_config.w32.h"
#else
# include "zend_config.h"
# define DL_FETCH_SYMBOL dlsym
# define DL_HANDLE void *
# define ZEND_EXTENSIONS_SUPPORT 1
-#elif (WIN32||WINNT)
+#elif (ZEND_WIN32)
# define DL_LOAD(libname) LoadLibrary(libname)
# define DL_FETCH_SYMBOL GetProcAddress
# define DL_UNLOAD FreeLibrary
#define ZEND_MAX_RESERVED_RESOURCES 1
-#if (WINNT|WIN32)
+#if (ZEND_WIN32)
/* Only use this macro if you know for sure that all of the switches values
are covered by its case statements */
#define EMPTY_SWITCH_DEFAULT_CASE() \
#define BYREF_ALLOW 2
#define BYREF_FORCE_REST 3
-#if !(WIN32||WINNT)
+#if !(ZEND_WIN32)
#define DLEXPORT
#endif
vsprintf(output_buf, format, args);
va_end(args);
-#if WIN32||WINNT
+#if ZEND_WIN32
OutputDebugString(output_buf);
#else
fprintf(stderr, output_buf);
int zend_startup_constants(ELS_D)
{
-#if WIN32|WINNT
+#if ZEND_WIN32
DWORD dwBuild=0;
DWORD dwVersion = GetVersion();
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
#endif
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && (WINNT|WIN32))
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && (ZEND_WIN32))
# define do_alloca(p) alloca(p)
# define free_alloca(p)
#else
handle = DL_LOAD(path);
if (!handle) {
-#if !(WIN32||WINNT)
+#if !(ZEND_WIN32)
fprintf(stderr, "Failed loading %s: %s\n", path, dlerror());
#else
fprintf(stderr, "Failed loading %s\n", path);