]> granicus.if.org Git - php/commitdiff
Fine tune Andi's patch
authorZeev Suraski <zeev@php.net>
Fri, 11 Feb 2000 15:59:30 +0000 (15:59 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 11 Feb 2000 15:59:30 +0000 (15:59 +0000)
50 files changed:
Zend/zend-scanner.l
Zend/zend.h
Zend/zend_API.h
Zend/zend_alloc.c
Zend/zend_config.w32.h
Zend/zend_constants.c
Zend/zend_execute.c
Zend/zend_extensions.c
ext/filepro/filepro.c
ext/imap/imap.c
ext/session/mod_files.c
ext/session/session.c
ext/snmp/snmp.c
ext/standard/array.c
ext/standard/basic_functions.c
ext/standard/basic_functions.h
ext/standard/crypt.c
ext/standard/dir.c
ext/standard/dl.c
ext/standard/dns.c
ext/standard/dns.h
ext/standard/exec.c
ext/standard/file.c
ext/standard/filestat.c
ext/standard/flock_compat.c
ext/standard/flock_compat.h
ext/standard/fsock.c
ext/standard/fsock.h
ext/standard/info.c
ext/standard/lcg.c
ext/standard/link.c
ext/standard/mail.c
ext/standard/microtime.c
ext/standard/pack.c
ext/standard/pageinfo.c
ext/standard/parsedate.y
ext/standard/string.c
ext/standard/syslog.c
ext/standard/uniqid.c
ext/zlib/zlib.c
main/SAPI.c
main/SAPI.h
main/configuration-parser.y
main/fopen_wrappers.c
main/fopen_wrappers.h
main/main.c
main/mergesort.c
main/php.h
main/php_realpath.c
sapi/cgi/cgi_main.c

index 6eed970a3eecc92c6af5601e167e1fc045191b3e..02ea8f54f9300ef6f912a81f61a53aa0647a4ef3 100644 (file)
@@ -33,7 +33,7 @@
 
 %{
 
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
 #include <winsock.h>
 #include <io.h>
 #endif
@@ -57,7 +57,7 @@
 # ifdef HAVE_STDIOSTREAM_H
 #  include <stdiostream.h>
 # endif
-# if ZEND_WIN32
+# ifdef 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 /*ZEND_WIN32*/
+#if 0 /*defined(ZEND_WIN32)*/
 #define YY_INPUT(buf,result,max_size) \
        if ( yyin->_tmpfname != "url" ){ \
        if ( yy_current_buffer->yy_is_interactive ) \
index c5685d63eee511e7fb503aca0bc1d270bc1f85c6..b54940f2f2c97c3c6d4b1a0f4af1f3864398308d 100644 (file)
  * general definitions
  */
 
-#if (defined(WINNT) && WINNT) || (defined(WIN32) && WIN32)
-#define ZEND_WIN32 1
-#else
-#define ZEND_WIN32 0
-#endif
-
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
 # include "zend_config.w32.h"
 #else
 # include "zend_config.h"
@@ -69,7 +63,7 @@
 # define DL_FETCH_SYMBOL                       dlsym
 # define DL_HANDLE                                     void *
 # define ZEND_EXTENSIONS_SUPPORT       1
-#elif (ZEND_WIN32)
+#elif defined(ZEND_WIN32)
 # define DL_LOAD(libname)                      LoadLibrary(libname)
 # define DL_FETCH_SYMBOL                       GetProcAddress
 # define DL_UNLOAD                                     FreeLibrary
@@ -356,7 +350,7 @@ END_EXTERN_C()
 
 #define ZEND_MAX_RESERVED_RESOURCES    1
 
-#if (ZEND_WIN32)
+#ifdef 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 e6d9f66fcbf09a97d52fe08b8922f7616336581f..cdd464248ff0b7e197ddb02d754ab0fd841c8641 100644 (file)
@@ -84,7 +84,7 @@ ZEND_API void wrong_param_count(void);
 #define BYREF_ALLOW 2
 #define BYREF_FORCE_REST 3
 
-#if !(ZEND_WIN32)
+#ifndef ZEND_WIN32
 #define DLEXPORT
 #endif
 
index 008e875a0045a4b49eb5e714bfff9c1f4da25ba4..d220694f0219e5076979b2bef4cd76ca16e502f4 100644 (file)
@@ -447,7 +447,7 @@ void zend_debug_alloc_output(char *format, ...)
        vsprintf(output_buf, format, args);
        va_end(args);
 
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
        OutputDebugString(output_buf);
 #else
        fprintf(stderr, output_buf);
index 8171727c2e6cc9462b379f5e5cdfce9a9f563b01..ee00133289ab5149dfd9d1c4727ae2757277b6bd 100644 (file)
@@ -51,7 +51,7 @@ typedef unsigned int uint;
 /* This will cause the compilation process to be MUCH longer, but will generate
  * a much quicker PHP binary
  */
-#ifdef ZEND_WIN32_FORCE_INLINE
+#ifdef defined(ZEND_WIN32)_FORCE_INLINE
 # define inline __forceinline
 #else
 # define inline
index 0972a9bd00e59db58d4cc801311e5cf0d0ef5e02..5e6b1a30758579bf45579f133d739555a5fa5ea9 100644 (file)
@@ -79,7 +79,7 @@ void clean_module_constants(int module_number)
 
 int zend_startup_constants(ELS_D)
 {
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
        DWORD dwBuild=0;
        DWORD dwVersion = GetVersion();
        DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
index c04c61042aee583cc4e4681bb15869258bd55f56..e737d43ae20fbd9117c72618d5d55e2d2e1c6eb2 100644 (file)
@@ -967,7 +967,7 @@ static int zend_check_symbol(zval **pz)
 #endif
 
 
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && (ZEND_WIN32))
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32))
 #      define do_alloca(p) alloca(p)
 #      define free_alloca(p)
 #else
index 11037ac59ff6b4b103e9d9d07071f5691660f19f..fb2f0710324a280376221ab6369564d40eec6c80 100644 (file)
@@ -49,7 +49,7 @@ int zend_load_extension(char *path)
 
        handle = DL_LOAD(path);
        if (!handle) {
-#if !(ZEND_WIN32)
+#ifndef ZEND_WIN32
                fprintf(stderr, "Failed loading %s:  %s\n", path, dlerror());
 #else
                fprintf(stderr, "Failed loading %s\n", path);
index 5e64632512ee091bd8943d0e8551494d36ba9926..cc055076aa3c5959ddb9a10adab2c92d764a875a 100644 (file)
@@ -27,7 +27,7 @@
 #include "safe_mode.h"
 #include "fopen-wrappers.h"
 #include <string.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <windows.h>
 #else
 #include <sys/param.h>
index 545f527882c023f6e1db18302310343a7c54b52a..45be5f3395cd55c0c4dd95cd7d8b028fef4bcf01 100644 (file)
@@ -3441,14 +3441,14 @@ PHP_FUNCTION(imap_mail_compose)
 #if !(WIN32|WINNT)
 int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath)
 {
-#if PHP_WIN32
+#ifdef PHP_WIN32
        int tsm_err;
 #else
        FILE *sendmail;
        int ret;
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if (imap_TSendMail(INI_STR("smtp"),&tsm_err,headers,subject,to,message,cc,bcc,rpath) != SUCCESS){
                php_error(E_WARNING, GetSMErrorText(tsm_err));
                return 0;
index 60870affb1652d75d2ba835afd29a69074815df9..e1f58732f0153b0dd0999609d388c21c06d0d006 100644 (file)
@@ -30,7 +30,7 @@
 #include <dirent.h>
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #define NEEDRDH 1
 #include "win32/readdir.h"
 #endif
@@ -56,7 +56,7 @@ ps_module ps_mod_files = {
        PS_MOD(files)
 };
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #define DIR_DELIMITER '\\'
 #else
 #define DIR_DELIMITER '/'
index 1fa912ddca988fb75c5d2cf88567852d746c9409..89a2447a67f0165ffc3e3a9a184b2820c1f691ca 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "php.h"
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/time.h"
 #else
 #include <sys/time.h>
index 18ddf4ef14093114fa05513ff194e0b750dff66b..5d4bed6daf26a0966b27084350775d58e08cb697 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 #include "php_snmp.h"
 #include <sys/types.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <winsock.h>
 #include <errno.h>
 #include <process.h>
index 5cd1da504b589daeda798e7ba013ef7426511254..0d47ed68e815feab97700c5197d6faa124732584 100644 (file)
@@ -30,7 +30,7 @@
 #else
 #include <strings.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/unistd.h"
 #endif
 #include "zend_globals.h"
index f8167cc45f8b9def5596e244dfe0a1af9bedc6b4..3e70b22f5de902834050fb02781fc6acd5c3e369 100644 (file)
@@ -42,7 +42,7 @@
 #include <locale.h>
 #endif
 #include "safe_mode.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/unistd.h"
 #endif
 #include "zend_globals.h"
@@ -194,7 +194,7 @@ function_entry basic_functions[] = {
        PHP_FE(gethostbyaddr,                                                   NULL)
        PHP_FE(gethostbyname,                                                   NULL)
        PHP_FE(gethostbynamel,                                                  NULL)
-#if !(PHP_WIN32)||HAVE_BINDLIB
+#if !defined(PHP_WIN32)||HAVE_BINDLIB
        PHP_FE(checkdnsrr,                                                              NULL)
        PHP_FE(getmxrr,                                                                 second_and_third_args_force_ref)
 #endif
index 6ce59564bb1734bed80118194ce01f5f089d635d..a77dabab8f7acb3f0a58a4c0afff7ca0475c708d 100644 (file)
@@ -107,7 +107,7 @@ PHP_FUNCTION(get_loaded_extensions);
 PHP_FUNCTION(extension_loaded);
 PHP_FUNCTION(get_extension_funcs);
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 typedef unsigned int php_stat_len;
 #else
 typedef int php_stat_len;
index fa217796dd77a4d02df5cf25d598fc06d02b4764..d76ba285800169565ac5f70662393c9b9ab6520d 100644 (file)
@@ -41,7 +41,7 @@
 #include <strings.h>
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <process.h>
 extern char *crypt(char *__key,char *__salt);
 #endif
index 88d78c983feafbb19d86cedab43de639fd8a9e02..11179e7f73817997d40cd647c28bc81b6ca91ae4 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <errno.h>
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #define NEEDRDH 1
 #include "win32/readdir.h"
 #endif
index a315b3663a1137fc4daec8e9e95d7cc3469453c1..2d6431b47c38ef63d5969d7aa08c1302274e017b 100644 (file)
@@ -33,7 +33,7 @@
 #else
 #include <strings.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/param.h"
 #include "win32/winutil.h"
 #else
@@ -113,7 +113,7 @@ void php_dl(pval *file,int type,pval *return_value)
                } else {
                        error_type = E_CORE_ERROR;
                }
-#if PHP_WIN32
+#ifdef PHP_WIN32
                php_error(error_type,"Unable to load dynamic library '%s'<br>\n%s",libpath,php_win_err());
 #else
                php_error(error_type,"Unable to load dynamic library '%s' - %s",libpath,dlerror());
index 359abef34d122470f689ef215b97d809907af95a..c06c017ed89ad5d768c7e50cc0c21fd8737e9244 100644 (file)
@@ -22,7 +22,7 @@
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #if HAVE_BINDLIB
 #ifndef WINNT
 #define WINNT 1
@@ -158,7 +158,7 @@ char *php_gethostbyname(char *name)
        return estrdup(inet_ntoa(in));
 }
 
-#if !(PHP_WIN32)||HAVE_BINDLIB
+#if !defined(PHP_WIN32)||HAVE_BINDLIB
 
 /* {{{ proto int checkdnsrr(string host [, string type])
    Check DNS records corresponding to a given Internet host name or IP address */
index 1dcd9ac4d308c63f30b3095921b661c05feb2dbe..1e5b755bd84fe54713dbbbb85735b8716f4dd5ae 100644 (file)
@@ -37,7 +37,7 @@
 PHP_FUNCTION(gethostbyaddr);
 PHP_FUNCTION(gethostbyname);
 PHP_FUNCTION(gethostbynamel);
-#if !(PHP_WIN32)||(HAVE_BINDLIB)
+#if !defined(PHP_WIN32)||(HAVE_BINDLIB)
 PHP_FUNCTION(checkdnsrr);
 PHP_FUNCTION(getmxrr);
 #endif
index 10aff1de45b2c55f7a82993cd1d2458e5fe93a8c..f12e3dd557c5303869969c7635d80d9643ec2848 100644 (file)
@@ -86,7 +86,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
                tmp = php_escape_shell_cmd(d);
                efree(d);
                d = tmp;
-#if PHP_WIN32
+#ifdef PHP_WIN32
                fp = popen(d, "rb");
 #else
                fp = popen(d, "r");
@@ -98,7 +98,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
                        return -1;
                }
        } else { /* not safe_mode */
-#if PHP_WIN32
+#ifdef PHP_WIN32
                fp = popen(cmd, "rb");
 #else
                fp = popen(cmd, "r");
@@ -363,7 +363,7 @@ PHP_FUNCTION(shell_exec)
        }
 
        convert_to_string_ex(cmd);
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if ((in=popen((*cmd)->value.str.val,"rt"))==NULL) {
 #else
        if ((in=popen((*cmd)->value.str.val,"r"))==NULL) {
index 7fdc9c7a0169ec7a8bd365ba2932739781e9f486..375ced7381c2a128d9b833b42ef53c637cb404eb 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <windows.h>
 #include <winsock.h>
 #define O_RDONLY _O_RDONLY
@@ -49,7 +49,7 @@
 #include "php_string.h"
 #include "file.h"
 #if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
@@ -58,7 +58,7 @@
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <winsock.h>
 #else
 #include <netinet/in.h>
@@ -832,7 +832,7 @@ PHPAPI int php_set_sock_blocking(int socketd, int block)
       int flags;
       int myflag = 0;
       
-#if PHP_WIN32
+#ifdef PHP_WIN32
       /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
          flags = block;
          if (ioctlsocket(socketd,FIONBIO,&flags)==SOCKET_ERROR){
@@ -1525,7 +1525,7 @@ PHP_FUNCTION(copy)
                RETURN_FALSE;
        }
        
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if ((fd_s=open((*source)->value.str.val,O_RDONLY|_O_BINARY))==-1) {
 #else
        if ((fd_s=open((*source)->value.str.val,O_RDONLY))==-1) {
@@ -1533,7 +1533,7 @@ PHP_FUNCTION(copy)
                php_error(E_WARNING,"Unable to open '%s' for reading:  %s",(*source)->value.str.val,strerror(errno));
                RETURN_FALSE;
        }
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if ((fd_t=open((*target)->value.str.val,_O_WRONLY|_O_CREAT|_O_TRUNC|_O_BINARY,_S_IREAD|_S_IWRITE))==-1){
 #else
        if ((fd_t=creat((*target)->value.str.val,0777))==-1) {
index e10ba6f7e20f70c2b4b4b07605395bd7f12725f9..dbbf47299323329e254127e65bd798147305b50c 100644 (file)
@@ -46,7 +46,7 @@
 #endif
 
 #if HAVE_PWD_H
-# if PHP_WIN32
+# ifdef PHP_WIN32
 #  include "win32/pwd.h"
 # else
 #  include <pwd.h>
@@ -54,7 +54,7 @@
 #endif
 
 #if HAVE_GRP_H
-# if PHP_WIN32
+# ifdef PHP_WIN32
 #  include "win32/grp.h"
 # else
 #  include <grp.h>
@@ -62,7 +62,7 @@
 #endif
 
 #if HAVE_UTIME
-# if PHP_WIN32
+# ifdef PHP_WIN32
 #  include <sys/utime.h>
 # else
 #  include <utime.h>
index 4328f3c6c159a8d3275073d133a8acdfb58b437a..eb52d41c41741a402b05b934d6d2b343cf2895d4 100644 (file)
@@ -28,7 +28,7 @@
 #include <fcntl.h>
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <windows.h>
 #include <io.h>
 #endif
@@ -64,7 +64,7 @@ int flock(int fd, int operation)
 
        return ret;
 }
-#elif PHP_WIN32
+#elif defined(PHP_WIN32)
 /*
  * Program:   Unix compatibility routines
  *
@@ -138,7 +138,7 @@ int flock(int fd, int operation)
        /* Under Win32 MT library, errno is not a variable but a function call,
         * which cannot be assigned to.
         */
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
     errno = EINVAL;             /* bad call */
 #endif
     return -1;
index bf927c4ae1fea789c2ad6b20b2e03544bbcf4656..002c046069c811c5cce04f8d2fd08313f779645a 100644 (file)
@@ -9,10 +9,10 @@
 int flock(int fd, int operation);
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #      define fsync _commit
 #      define ftruncate chsize
-#endif /* PHP_WIN32 */
+#endif /* defined(PHP_WIN32) */
 
 #if !HAVE_INET_ATON
 #if HAVE_NETINET_IN_H
index 4e01400dd8fd259672c4663040ad15f6608a45f4..fc1458b5f64ae0a29ad760133dcee2d2784ba763 100644 (file)
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <winsock.h>
 #else
 #include <netinet/in.h>
 #include <netdb.h>
 #include <arpa/inet.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #undef AF_UNIX
 #endif
 #if defined(AF_UNIX)
@@ -89,7 +89,7 @@ extern int le_fp;
 #define SEARCHCR() \
        p = memchr(READPTR(sock), '\n', MIN(TOREAD(sock), maxlen));
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #define EWOULDBLOCK WSAEWOULDBLOCK
 #else
 #include "build-defs.h"
@@ -158,7 +158,7 @@ PHPAPI int connect_nonb(int sockfd,
                                                struct timeval *timeout)
 {
 /* probably won't work on Win32, someone else might try it (read: fix it ;) */
-#if !PHP_WIN32 && (defined(O_NONBLOCK) || defined(O_NDELAY))
+#if !defined(PHP_WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
 
 #ifndef O_NONBLOCK
 #define O_NONBLOCK O_NDELAY
@@ -216,7 +216,7 @@ PHPAPI int connect_nonb(int sockfd,
                ret = -1;
        }
        return ret;
-#else /* !PHP_WIN32 && ... */
+#else /* !defined(PHP_WIN32) && ... */
       return connect(sockfd, addr, addrlen);
 #endif
 }
@@ -483,7 +483,7 @@ int php_sockdestroy(int socket)
        return ret;
 }
 
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
 #undef closesocket
 #define closesocket close
 #endif
index 80d740c9fed69639a156b6ed85fc2ab98f37361a..775f544b1e42bad3b44cc14356826a2e89d98673 100644 (file)
@@ -34,7 +34,7 @@
 #ifndef _FSOCK_H
 #define _FSOCK_H
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # ifndef WINNT
 #  define WINNT 1
 # endif
index 2d67134096702d34ccc7af425bf12c7fb098d0e5..f4058636d349fc7175ec8eaf0d9ac383df7f7f91 100644 (file)
@@ -23,7 +23,7 @@
 #include "ext/standard/head.h"
 #include "info.h"
 #include "SAPI.h"
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
 #include "build-defs.h"
 #endif
 #include "zend_globals.h"              /* needs ELS */
@@ -108,7 +108,7 @@ PHPAPI void php_print_info(int flag)
        char **env,*tmp1,*tmp2;
        char *php_uname;
        int expose_php = INI_INT("expose_php");
-#if PHP_WIN32
+#ifdef PHP_WIN32
        char php_windows_uname[256];
        DWORD dwBuild=0;
        DWORD dwVersion = GetVersion();
@@ -120,7 +120,7 @@ PHPAPI void php_print_info(int flag)
 
        
        if (flag & PHP_INFO_GENERAL) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
                // Get build numbers for Windows NT or Win95
                if (dwVersion < 0x80000000){
                        dwBuild = (DWORD)(HIWORD(dwVersion));
index 48d4b7f75fad81556c5e7bfe4d639724d99a6f45..76d7168ca308829f34a8b0a492ca746b0faaa04c 100644 (file)
@@ -29,7 +29,7 @@ int lcg_globals_id;
 static php_lcg_globals lcg_globals;
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <process.h>
 #endif
 
index 6e7e0da8552b7b5b511d097af8930b8d1f1b949f..ad6e8e1b33584a83cd0bc25d8734f71dbe4fe747 100644 (file)
 #include <sys/stat.h>
 #include <string.h>
 #if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
 #endif
 #endif
 #if HAVE_GRP_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/grp.h"
 #else
 #include <grp.h>
index ebb20bf6601344ea59ac0b84b9034efb1f2b8a59..18d9a68b83db456a3273443801148058622ea936 100644 (file)
 #include <ctype.h>
 #include <stdio.h>
 #include "php.h"
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
 #include "build-defs.h"
 #endif
 #include "php_mail.h"
 #include "php_ini.h"
 
 #if HAVE_SENDMAIL
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/sendmail.h"
 #endif
 
@@ -102,7 +102,7 @@ PHP_FUNCTION(mail)
 
 int php_mail(char *to, char *subject, char *message, char *headers)
 {
-#if PHP_WIN32
+#ifdef PHP_WIN32
        int tsm_err;
 #else
        FILE *sendmail;
@@ -110,7 +110,7 @@ int php_mail(char *to, char *subject, char *message, char *headers)
        char *sendmail_path = INI_STR("sendmail_path");
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if (TSendMail(INI_STR("SMTP"), &tsm_err, headers, subject, to, message) != SUCCESS){
                php_error(E_WARNING, GetSMErrorText(tsm_err));
                return 0;
@@ -144,7 +144,7 @@ int php_mail(char *to, char *subject, char *message, char *headers)
 
 PHP_MINFO_FUNCTION(mail)
 {
-#if PHP_WIN32
+#ifdef PHP_WIN32
        PUTS("Internal Sendmail support for Windows 4");
 #else
        php_printf("Path to sendmail: <tt>%s</tt>", INI_STR("sendmail_path"));
index 5b84070abbf75360c42e7bd0d72ff6c0690bce9f..dad5ca8d0b8a5812dda122b40edb2d348711301c 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <stdio.h>
 #ifdef HAVE_GETTIMEOFDAY
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/time.h"
 #else
 #include <sys/time.h>
index 230477216b79e24a83157db52709d149343edb28..b10988fafe3f6896fc7a3d34da60eafe8bc4b866 100644 (file)
@@ -25,7 +25,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <windows.h>
 #include <winsock.h>
 #define O_RDONLY _O_RDONLY
@@ -38,7 +38,7 @@
 #include "php_string.h"
 #include "pack.h"
 #if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
index d232b3f086340f2523333b3924e6fc230e7e14d4..c0c7daf4294126e49375d08ae9e948ca0c953037 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
@@ -34,7 +34,7 @@
 #include <unistd.h>
 #endif
 #include <sys/stat.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <process.h>
 #endif
 
index ff1b2703508539b26c50b02aca8b8a38a2f0cc0e..819af8235d5b13b11bb14afbed36795681521135 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "php.h"
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <malloc.h>
 #endif
 
@@ -36,7 +36,7 @@
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # include "win32/time.h"
 #endif
 
index a866d9c5ad6204b45e4191aaaeb526a738b84917..9a3dacc7a9f67de4a06772448dc54c32914f5de9 100644 (file)
@@ -471,14 +471,14 @@ PHP_FUNCTION(basename)
        ret = estrdup((*str)->value.str.val);
        c = ret + (*str)->value.str.len -1;     
        while (*c == '/'
-#if PHP_WIN32
+#ifdef PHP_WIN32
                   || *c == '\\'
 #endif
                )
                c--;
        *(c + 1) = '\0';        
        if ((c = strrchr(ret, '/'))
-#if PHP_WIN32
+#ifdef PHP_WIN32
                || (c = strrchr(ret, '\\'))
 #endif
                ) {
@@ -495,14 +495,14 @@ PHPAPI void php_dirname(char *str, int len) {
 
        c = str + len - 1;
        while (*c == '/'
-#if PHP_WIN32
+#ifdef PHP_WIN32
                   || *c == '\\'
 #endif
                )
                c--; /* strip trailing slashes */
        *(c + 1) = '\0';
        if ((c = strrchr(str, '/'))
-#if PHP_WIN32
+#ifdef PHP_WIN32
                || (c = strrchr(str, '\\'))
 #endif
                )
index de25a5ecce797918f89f77f12e602299b89b7abc..343ed2114d57ac110e14f59421fe8f94d4e79456 100644 (file)
@@ -26,7 +26,7 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/syslog.h"
 #else
 #include <syslog.h>
@@ -77,7 +77,7 @@ PHP_MINIT_FUNCTION(syslog)
        /* AIX doesn't have LOG_AUTHPRIV */
        REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT);
 #endif
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
        REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT);
@@ -160,7 +160,7 @@ static void start_syslog(void)
        /* AIX doesn't have LOG_AUTHPRIV */
        SET_VAR_LONG("LOG_AUTHPRIV", LOG_AUTHPRIV);
 #endif
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
        SET_VAR_LONG("LOG_LOCAL0", LOG_LOCAL0);
        SET_VAR_LONG("LOG_LOCAL1", LOG_LOCAL1);
        SET_VAR_LONG("LOG_LOCAL2", LOG_LOCAL2);
index 9e4200ab74aa03bc58515cd4897af9058342f1c7..30ab4473ec1a31cbda22f2e89f476df4692b9c2d 100644 (file)
@@ -29,7 +29,7 @@
 #include <errno.h>
 
 #include <stdio.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/time.h"
 #else
 #include <sys/time.h>
@@ -64,7 +64,7 @@ PHP_FUNCTION(uniqid)
                php_error(E_WARNING, "The prefix to uniqid should not be more than 114 characters.");
                return;
        }
-#if HAVE_USLEEP && !(PHP_WIN32)
+#if HAVE_USLEEP && !defined(PHP_WIN32)
        if (!MORE_ENTROPY) {
                usleep(1);
        }
index 1b8b39e23a66aedab24fff2e02141915bc952d38..120aaa8285968e2a7476bd43594afd2e0aceb6fe 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <windows.h>
 #include <winsock.h>
 #define O_RDONLY _O_RDONLY
@@ -42,7 +42,7 @@
 #include "php_zlib.h"
 #include "fopen-wrappers.h"
 #if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
@@ -50,7 +50,7 @@
 #endif
 #include "snprintf.h"
 #if HAVE_ZLIB
-#if defined(HAVE_UNISTD_H) && PHP_WIN32
+#if defined(HAVE_UNISTD_H) && defined(PHP_WIN32)
 #undef HAVE_UNISTD_H
 #endif
 
@@ -197,7 +197,7 @@ static gzFile *php_gzopen_with_path(char *filename, char *mode, char *path, char
        }
 
        /* Absolute path open - prepend document_root in safe mode */
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if ((*filename == '\\')||(*filename == '/')||(filename[1] == ':')) {
 #else
        if (*filename == '/') {
@@ -240,7 +240,7 @@ static gzFile *php_gzopen_with_path(char *filename, char *mode, char *path, char
        ptr = pathbuf;
 
        while (ptr && *ptr) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
                end = strchr(ptr, ';');
 #else
                end = strchr(ptr, ':');
index 04000a8bb49deddfb1dd053941bf376b69e71d9f..0d5c1741162c9056d5f5cb6a2fc2587102ca5a5b 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "rfc1867.h"
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #define STRCASECMP stricmp
 #else
 #define STRCASECMP strcasecmp
index bb42da48e1c7a3da6e29db551f414ebb0a0db7ae..c5fdd13982623ef9d6866e1bcfcee3ca9f6bb012 100644 (file)
@@ -27,7 +27,7 @@
 
 #define SAPI_POST_BLOCK_SIZE 4000
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #      ifdef SAPI_EXPORTS
 #      define SAPI_API __declspec(dllexport) 
 #      else
index 88804694fd424b99cd52f494bfea5c4a698cfcd6..0991c1e5699574751cab0b9e7f6fd5370167680d 100644 (file)
@@ -161,7 +161,7 @@ int php_init_config(void)
                if (!env_location) {
                        env_location="";
                }
-#if PHP_WIN32
+#ifdef PHP_WIN32
                {
                        if (php_ini_path) {
                                default_location = php_ini_path;
@@ -186,7 +186,7 @@ int php_init_config(void)
                php_ini_search_path = (char *) malloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1);
 
                if (!php_ini_path) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
                        sprintf(php_ini_search_path,".;%s;%s",env_location,default_location);
 #else
                        sprintf(php_ini_search_path,".:%s:%s",env_location,default_location);
@@ -206,7 +206,7 @@ int php_init_config(void)
                PG(open_basedir) = open_basedir;
 
                if (!cfgin) {
-# if PHP_WIN32
+# ifdef PHP_WIN32
                        return FAILURE;
 # else
                        return SUCCESS;  /* having no configuration file is ok */
index db9f783fff77e27296f48cd09941eff69e36b953..e3b0c15e487502280054e9511d4275c7e3ef59a6 100644 (file)
@@ -29,7 +29,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <windows.h>
 #include <winsock.h>
 #define O_RDONLY _O_RDONLY
@@ -45,7 +45,7 @@
 #include "zend_compile.h"
 
 #if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
@@ -61,7 +61,7 @@
 #define S_ISREG(mode)  (((mode)&S_IFMT) == S_IFREG)
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <winsock.h>
 #else
 #include <netinet/in.h>
@@ -69,7 +69,7 @@
 #include <arpa/inet.h>
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #undef AF_UNIX
 #endif
 
@@ -105,7 +105,7 @@ PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC)
 
                /* Strip filename */
                while ((
-#if PHP_WIN32
+#ifdef PHP_WIN32
                        (local_open_basedir[local_open_basedir_pos] != '\\') ||
 #endif
                        (local_open_basedir[local_open_basedir_pos] != '/')
@@ -122,7 +122,7 @@ PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC)
        /* Resolve the real path into resolved_name */
        if ((php_realpath(path, resolved_name) != NULL) && (php_realpath(local_open_basedir, resolved_basedir) != NULL)) {
                /* Check the path */
-#if PHP_WIN32
+#ifdef PHP_WIN32
                if (strncasecmp(resolved_basedir, resolved_name, strlen(resolved_basedir)) == 0) {
 #else
                if (strncmp(resolved_basedir, resolved_name, strlen(resolved_basedir)) == 0) {
@@ -153,7 +153,7 @@ PHPAPI int php_check_open_basedir(char *path)
                ptr = pathbuf;
 
                while (ptr && *ptr) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
                        end = strchr(ptr, ';');
 #else
                        end = strchr(ptr, ':');
@@ -338,7 +338,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
                return fp;
        }
        /* Absolute path open - prepend document_root in safe mode */
-#if PHP_WIN32
+#ifdef PHP_WIN32
        if ((*filename == '\\') || (*filename == '/') || (filename[1] == ':')) {
 #else
        if (*filename == '/') {
@@ -379,7 +379,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
        ptr = pathbuf;
 
        while (ptr && *ptr) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
                end = strchr(ptr, ';');
 #else
                end = strchr(ptr, ':');
index 721502248a28e82d3362d29c1117cc0ea5581959..3e89ab17bbf4a2834f98012ff6af6d0b84a3dabc 100644 (file)
 #define USE_PATH       1
 #define IGNORE_URL     2
 /* There's no USE_URL. */
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # define IGNORE_URL_WIN 2
 #else
 # define IGNORE_URL_WIN 0
 #endif
 #define ENFORCE_SAFE_MODE 4
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # define SOCK_ERR INVALID_SOCKET
 # define SOCK_CONN_ERR SOCKET_ERROR
 # define SOCK_RECV_ERR SOCKET_ERROR
index e37608b0ba2bd28943b8fd36108cbb6dea5e48a3..b1a0898b58ba17fcc5a344b081dd7af0385ef300 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <stdio.h>
 #include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/time.h"
 #include "win32/signal.h"
 #include <process.h>
@@ -51,7 +51,7 @@
 #include "ext/standard/php_standard.h"
 #include "snprintf.h"
 #include "php_variables.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <io.h>
 #include <fcntl.h>
 #include "win32/syslog.h"
@@ -453,7 +453,7 @@ static void php_timeout(int dummy)
 
 static void php_set_timeout(long seconds)
 {
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #else
 #      ifdef HAVE_SETITIMER
        struct itimerval t_r;           /* timeout requested */
@@ -471,7 +471,7 @@ static void php_set_timeout(long seconds)
 
 static void php_unset_timeout(void)
 {
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #else
 #      ifdef HAVE_SETITIMER
        struct itimerval no_timeout;
@@ -591,7 +591,7 @@ static void php_message_handler_for_zend(long message, void *data)
 
                                                snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":""));
                                        }
-#      if PHP_WIN32
+#      if defined(PHP_WIN32)
                                        OutputDebugString(memory_leak_buf);
 #      else
                                        fprintf(stderr, memory_leak_buf);
@@ -772,11 +772,11 @@ int php_module_startup(sapi_module_struct *sf)
        php_core_globals *core_globals;
        sapi_globals_struct *sapi_globals = ts_resource(sapi_globals_id);
 #endif
-#if (PHP_WIN32) && !(USE_SAPI)
+#ifdef PHP_WIN32
        WORD wVersionRequested = MAKEWORD(2, 0);
        WSADATA wsaData;
 #endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
        {
                DWORD dwVersion = GetVersion();
 
@@ -832,7 +832,7 @@ int php_module_startup(sapi_module_struct *sf)
        setlocale(LC_CTYPE, "");
 #endif
 
-#if (PHP_WIN32) && !(USE_SAPI)
+#ifdef PHP_WIN32
        /* start up winsock services */
        if (WSAStartup(wVersionRequested, &wsaData) != 0) {
                php_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError());
@@ -897,7 +897,7 @@ void php_module_shutdown()
        /* close down the ini config */
        php_config_ini_shutdown();
 
-#if (PHP_WIN32)
+#ifdef PHP_WIN32
        /*close winsock */
        WSACleanup();
 #endif
@@ -1102,7 +1102,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
                return;
        }
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
        UpdateIniFromRegistry(primary_file->filename);
 #endif
 
@@ -1129,7 +1129,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
        }
 }
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 /* just so that this symbol gets exported... */
 PHPAPI void dummy_indent()
 {
index 40d756d6bab25559d7c7ca2979bb8ba7a4c04fe9..b173bc1269e845f4bef6beadce65d8a30d7818b0 100644 (file)
@@ -60,7 +60,7 @@ static char sccsid[] = "@(#)merge.c   8.2 (Berkeley) 2/14/94";
 
 #include "php.h"
 
-#if (PHP_WIN32)
+#ifdef PHP_WIN32
 #include <winsock.h> /* Includes definition for u_char */
 #endif
 
index 9d710dbac13fbe4e9eef3e52527fe565f281d55f..ccccc7850904eed9d79c79269b92c99ef3ddf2ba 100644 (file)
@@ -33,8 +33,6 @@
 #include "php_version.h"
 #include "zend.h"
 
-#define PHP_WIN32 ZEND_WIN32
-
 /* automake defines PACKAGE and VERSION for Zend too */
 #ifdef PACKAGE
 # undef PACKAGE
@@ -59,7 +57,7 @@ extern unsigned char second_arg_allow_ref[];
 */
 
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "config.w32.h"
 #include "win95nt.h"
 #      ifdef PHP_EXPORTS
@@ -80,7 +78,7 @@ extern unsigned char second_arg_allow_ref[];
 #define DEBUG ZEND_DEBUG
 
 
-#if DEBUG || !(defined(__GNUC__)||PHP_WIN32)
+#if DEBUG || !(defined(__GNUC__)||defined(PHP_WIN32))
 #ifdef inline
 #undef inline
 #endif
@@ -170,7 +168,7 @@ extern char *strerror(int);
 #endif
 
 #if HAVE_PWD_H
-# if PHP_WIN32
+# ifdef PHP_WIN32
 #include "win32/pwd.h"
 #include "win32/param.h"
 # else
@@ -242,7 +240,7 @@ extern int ap_vsnprintf(char *, size_t, const char *, va_list);
 
 /* global variables */
 extern pval *data;
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
 extern char **environ;
 #define php_sleep sleep
 #endif
index c6edfb0cca6cc429e54a312c0a24e1ac5906fa04..1385893ce028d5ecca8442ae3ff312dda88f8131 100644 (file)
@@ -40,7 +40,7 @@ char *php_realpath(char *path, char resolved_path []) {
        char path_copy[MAXPATHLEN];                             /* A work-copy of the path */
        char *workpos;                                                  /* working position in *path */
 
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
        char buf[MAXPATHLEN];                                   /* Buffer for readlink */
        int linklength;                                                 /* The result from readlink */
 #endif
@@ -48,7 +48,7 @@ char *php_realpath(char *path, char resolved_path []) {
        
        struct stat filestat;                                   /* result from stat */
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
        char *temppos;                                          /* position while counting '.' */
        int dotcount;                                           /* number of '.' */
        int t;                                                          /* counter */
@@ -58,7 +58,7 @@ char *php_realpath(char *path, char resolved_path []) {
        strcpy(path_copy, path);
        workpos = path_copy;
        
-#if PHP_WIN32
+#ifdef PHP_WIN32
        /* Find out where we start - Windows version */
        if ((*workpos == '\\') || (*workpos == '/')) {
                /* We start at the root of the current drive */
@@ -109,13 +109,13 @@ char *php_realpath(char *path, char resolved_path []) {
        /* Go to the end, then stop */
        while(*workpos != 0) {
                /* Strip (back)slashes */
-#if PHP_WIN32
+#ifdef PHP_WIN32
                while(*workpos == '\\') workpos++;
 #else
                while(*workpos == '/') workpos++;
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
                /* reset dotcount */
                dotcount = 0;
 
@@ -169,7 +169,7 @@ char *php_realpath(char *path, char resolved_path []) {
                        *writepos++ = *workpos++;
                }
                *writepos = 0;
-#else /* PHP_WIN32 */
+#else /* defined(PHP_WIN32) */
                /* Look for .. */
                if ((workpos[0] == '.') && (workpos[1] != 0)) {
                        if ((workpos[1] == '.') && ((workpos[2] == '/') || (workpos[2] == 0))) {
@@ -247,7 +247,7 @@ char *php_realpath(char *path, char resolved_path []) {
                        *writepos++ = *workpos++;
                }
                *writepos = 0;
-#endif /* PHP_WIN32 */
+#endif /* defined(PHP_WIN32) */
        }
 
        /* Check if the resolved path is a directory */
index e83830f2869c3414c73fb1bac4a4b915e589bf69..8d3cbf263a677f5297e85256598637a768d2df28 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <stdio.h>
 #include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/time.h"
 #include "win32/signal.h"
 #include <process.h>
@@ -249,7 +249,7 @@ static void init_request_info(SLS_D)
        if (!script_filename) {
                script_filename = SG(request_info).argv0;
        }
-#if PHP_WIN32
+#ifdef PHP_WIN32
        /* FIXME WHEN APACHE NT IS FIXED */
        /* a hack for apache nt because it does not appear to set argv[1] and sets
           script filename to php.exe thus makes us parse php.exe instead of file.php