summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-02-10 17:03:53 +0000
committerAndi Gutmans <andi@php.net>2000-02-10 17:03:53 +0000
commitbc5c9d8d7b0a32e6d716141c0ff2d7f5015c4658 (patch)
tree8b28c846ebb36bdf6d3ce3a087be70ba479c17f8 /Zend
parent945e9c3f2098685e2960b825b95737843a356581 (diff)
downloadphp-git-bc5c9d8d7b0a32e6d716141c0ff2d7f5015c4658.tar.gz
- Finally beautify those WIN32|WINNT checks
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend-scanner.l6
-rw-r--r--Zend/zend.h8
-rw-r--r--Zend/zend_API.h2
-rw-r--r--Zend/zend_alloc.c2
-rw-r--r--Zend/zend_constants.c2
-rw-r--r--Zend/zend_execute.c2
-rw-r--r--Zend/zend_extensions.c2
7 files changed, 13 insertions, 11 deletions
diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l
index 23ad787306..6eed970a3e 100644
--- a/Zend/zend-scanner.l
+++ b/Zend/zend-scanner.l
@@ -33,7 +33,7 @@
%{
-#if WIN32|WINNT
+#if ZEND_WIN32
#include <winsock.h>
#include <io.h>
#endif
@@ -57,7 +57,7 @@
# ifdef HAVE_STDIOSTREAM_H
# include <stdiostream.h>
# endif
-# if WIN32||WINNT
+# if ZEND_WIN32
# include <strstrea.h>
# else
# include <strstream.h>
@@ -668,7 +668,7 @@ int yyFlexLexer::yylex()
/* 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 ) \
diff --git a/Zend/zend.h b/Zend/zend.h
index 94e9cc0f7f..00e4a67d97 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -37,7 +37,9 @@
* 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"
@@ -63,7 +65,7 @@
# 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
@@ -350,7 +352,7 @@ END_EXTERN_C()
#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() \
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 29eef8fdb5..e6d9f66fcb 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -84,7 +84,7 @@ ZEND_API void wrong_param_count(void);
#define BYREF_ALLOW 2
#define BYREF_FORCE_REST 3
-#if !(WIN32||WINNT)
+#if !(ZEND_WIN32)
#define DLEXPORT
#endif
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index d520551149..008e875a00 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -447,7 +447,7 @@ void zend_debug_alloc_output(char *format, ...)
vsprintf(output_buf, format, args);
va_end(args);
-#if WIN32||WINNT
+#if ZEND_WIN32
OutputDebugString(output_buf);
#else
fprintf(stderr, output_buf);
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index c3a1d0b7ba..0972a9bd00 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -79,7 +79,7 @@ void clean_module_constants(int module_number)
int zend_startup_constants(ELS_D)
{
-#if WIN32|WINNT
+#if ZEND_WIN32
DWORD dwBuild=0;
DWORD dwVersion = GetVersion();
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 1cc7f389d7..c04c61042a 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -967,7 +967,7 @@ static int zend_check_symbol(zval **pz)
#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
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index c08e0c086a..11037ac59f 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -49,7 +49,7 @@ int zend_load_extension(char *path)
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);