]> granicus.if.org Git - php/commitdiff
- Finally beautify those WIN32|WINNT checks
authorAndi Gutmans <andi@php.net>
Thu, 10 Feb 2000 17:03:53 +0000 (17:03 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 10 Feb 2000 17:03:53 +0000 (17:03 +0000)
Zend/zend-scanner.l
Zend/zend.h
Zend/zend_API.h
Zend/zend_alloc.c
Zend/zend_constants.c
Zend/zend_execute.c
Zend/zend_extensions.c

index 23ad787306f75e63ccd6b4d3c9c45cc6fbfaa691..6eed970a3eecc92c6af5601e167e1fc045191b3e 100644 (file)
@@ -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 ) \
index 94e9cc0f7f77691a84f98433bc5079cdcb6c145c..00e4a67d975b7db5410a2050878d751f94efc0bb 100644 (file)
@@ -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() \
index 29eef8fdb5cee694cf75ad8ad09ef619e5bfdcb1..e6d9f66fcbf09a97d52fe08b8922f7616336581f 100644 (file)
@@ -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
 
index d520551149a2802af63deb92baa54215015bba3f..008e875a0045a4b49eb5e714bfff9c1f4da25ba4 100644 (file)
@@ -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);
index c3a1d0b7ba91ef143b48e508654aa8778e0e09b8..0972a9bd00e59db58d4cc801311e5cf0d0ef5e02 100644 (file)
@@ -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)));
index 1cc7f389d7f0e78722a7c51e6f2477768cd0076f..c04c61042aee583cc4e4681bb15869258bd55f56 100644 (file)
@@ -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
index c08e0c086a9029e8d6277811adef7e3effb32f06..11037ac59ff6b4b103e9d9d07071f5691660f19f 100644 (file)
@@ -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);