]> granicus.if.org Git - php/commitdiff
- Get rid of some more evil MSVC5's and switch standard/ to use PHP_WIN32
authorAndi Gutmans <andi@php.net>
Thu, 10 Feb 2000 21:53:56 +0000 (21:53 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 10 Feb 2000 21:53:56 +0000 (21:53 +0000)
26 files changed:
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

index 0a6656001cbc5fbae2707254827f09020da4c627..5cd1da504b589daeda798e7ba013ef7426511254 100644 (file)
@@ -30,7 +30,7 @@
 #else
 #include <strings.h>
 #endif
-#if WIN32|WINNT
+#if PHP_WIN32
 #include "win32/unistd.h"
 #endif
 #include "zend_globals.h"
index 953eebe7f2706b84603096640d0e636e30becfb1..f8167cc45f8b9def5596e244dfe0a1af9bedc6b4 100644 (file)
@@ -42,7 +42,7 @@
 #include <locale.h>
 #endif
 #include "safe_mode.h"
-#if WIN32|WINNT
+#if 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 !(WIN32|WINNT)||HAVE_BINDLIB
+#if !(PHP_WIN32)||HAVE_BINDLIB
        PHP_FE(checkdnsrr,                                                              NULL)
        PHP_FE(getmxrr,                                                                 second_and_third_args_force_ref)
 #endif
index 62468cbba408f5ccd02c49a81c82304781896800..6ce59564bb1734bed80118194ce01f5f089d635d 100644 (file)
@@ -107,7 +107,7 @@ PHP_FUNCTION(get_loaded_extensions);
 PHP_FUNCTION(extension_loaded);
 PHP_FUNCTION(get_extension_funcs);
 
-#if MSVC5
+#if PHP_WIN32
 typedef unsigned int php_stat_len;
 #else
 typedef int php_stat_len;
index a3fe1d4da75a247305a39745aa3ccffb63c989ef..fa217796dd77a4d02df5cf25d598fc06d02b4764 100644 (file)
@@ -41,7 +41,7 @@
 #include <strings.h>
 #endif
 
-#if MSVC5
+#if PHP_WIN32
 #include <process.h>
 extern char *crypt(char *__key,char *__salt);
 #endif
index aa3a3e3accc42060921b25c30646b5974f27a9d8..88d78c983feafbb19d86cedab43de639fd8a9e02 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <errno.h>
 
-#if WIN32||WINNT
+#if PHP_WIN32
 #define NEEDRDH 1
 #include "win32/readdir.h"
 #endif
index 86decf5d371b0504979a799d5ba86b292e90ba86..a315b3663a1137fc4daec8e9e95d7cc3469453c1 100644 (file)
@@ -33,7 +33,7 @@
 #else
 #include <strings.h>
 #endif
-#if MSVC5
+#if 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 MSVC5
+#if 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 112af6ed797d745b5c4d2998a8d7562db6afbbcd..359abef34d122470f689ef215b97d809907af95a 100644 (file)
@@ -22,7 +22,7 @@
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#if WIN32|WINNT
+#if 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 !(WIN32|WINNT)||HAVE_BINDLIB
+#if !(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 9d2c6cec0b92f0bb33a27362686f37bb168c053b..1dcd9ac4d308c63f30b3095921b661c05feb2dbe 100644 (file)
@@ -37,7 +37,7 @@
 PHP_FUNCTION(gethostbyaddr);
 PHP_FUNCTION(gethostbyname);
 PHP_FUNCTION(gethostbynamel);
-#if !(WIN32|WINNT)||(HAVE_BINDLIB)
+#if !(PHP_WIN32)||(HAVE_BINDLIB)
 PHP_FUNCTION(checkdnsrr);
 PHP_FUNCTION(getmxrr);
 #endif
index c450d17ecdcaec4fff2ac3a01e6857d7476560aa..10aff1de45b2c55f7a82993cd1d2458e5fe93a8c 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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if PHP_WIN32
        if ((in=popen((*cmd)->value.str.val,"rt"))==NULL) {
 #else
        if ((in=popen((*cmd)->value.str.val,"r"))==NULL) {
index d1f7792ba927c4632fb2c49b66254b94f8ebd89c..7fdc9c7a0169ec7a8bd365ba2932739781e9f486 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if MSVC5
+#if 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 MSVC5
+#if 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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if 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 1ada3d506651f7639708524e141e53ce583ba875..e10ba6f7e20f70c2b4b4b07605395bd7f12725f9 100644 (file)
@@ -46,7 +46,7 @@
 #endif
 
 #if HAVE_PWD_H
-# if MSVC5
+# if PHP_WIN32
 #  include "win32/pwd.h"
 # else
 #  include <pwd.h>
@@ -54,7 +54,7 @@
 #endif
 
 #if HAVE_GRP_H
-# if MSVC5
+# if PHP_WIN32
 #  include "win32/grp.h"
 # else
 #  include <grp.h>
@@ -62,7 +62,7 @@
 #endif
 
 #if HAVE_UTIME
-# if MSVC5
+# if PHP_WIN32
 #  include <sys/utime.h>
 # else
 #  include <utime.h>
index dfdde300ef36ec1cb6c988d1211ce97338516f0b..4328f3c6c159a8d3275073d133a8acdfb58b437a 100644 (file)
@@ -28,7 +28,7 @@
 #include <fcntl.h>
 #endif
 
-#if WIN32|WINNT
+#if PHP_WIN32
 #include <windows.h>
 #include <io.h>
 #endif
@@ -64,7 +64,7 @@ int flock(int fd, int operation)
 
        return ret;
 }
-#elif WIN32|WINNT
+#elif 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 !(WIN32|WINNT)
+#if !(PHP_WIN32)
     errno = EINVAL;             /* bad call */
 #endif
     return -1;
index 59c8e3bea47b3a1d5e317216dda6ffca62bca3b3..bf927c4ae1fea789c2ad6b20b2e03544bbcf4656 100644 (file)
@@ -9,10 +9,10 @@
 int flock(int fd, int operation);
 #endif
 
-#if WIN32|WINNT
+#if PHP_WIN32
 #      define fsync _commit
 #      define ftruncate chsize
-#endif /* WIN32|WINNT */
+#endif /* PHP_WIN32 */
 
 #if !HAVE_INET_ATON
 #if HAVE_NETINET_IN_H
index f343837488266af933ad5e816dbd25f6b6b94466..4e01400dd8fd259672c4663040ad15f6608a45f4 100644 (file)
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#ifdef WIN32
+#if PHP_WIN32
 #include <winsock.h>
 #else
 #include <netinet/in.h>
 #include <netdb.h>
 #include <arpa/inet.h>
 #endif
-#ifdef WIN32
+#if 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 WIN32|WINNT
+#if 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 !defined(WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
+#if !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 /* !defined(WIN32) && ... */
+#else /* !PHP_WIN32 && ... */
       return connect(sockfd, addr, addrlen);
 #endif
 }
@@ -483,7 +483,7 @@ int php_sockdestroy(int socket)
        return ret;
 }
 
-#if !defined(WIN32) && !defined(WINNT)
+#if !PHP_WIN32
 #undef closesocket
 #define closesocket close
 #endif
index ff6c85d5b325178a58936934d01385a377b255f3..80d740c9fed69639a156b6ed85fc2ab98f37361a 100644 (file)
@@ -34,7 +34,7 @@
 #ifndef _FSOCK_H
 #define _FSOCK_H
 
-#if WIN32|WINNT
+#if PHP_WIN32
 # ifndef WINNT
 #  define WINNT 1
 # endif
index 57e6933ff5558bff9f2dcc60e08d6cf4bf3861ff..2d67134096702d34ccc7af425bf12c7fb098d0e5 100644 (file)
@@ -23,7 +23,7 @@
 #include "ext/standard/head.h"
 #include "info.h"
 #include "SAPI.h"
-#ifndef MSVC5
+#if !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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if PHP_WIN32
                // Get build numbers for Windows NT or Win95
                if (dwVersion < 0x80000000){
                        dwBuild = (DWORD)(HIWORD(dwVersion));
index 3cd1e64aed735820125845321fa96766ad2d9b04..48d4b7f75fad81556c5e7bfe4d639724d99a6f45 100644 (file)
@@ -29,7 +29,7 @@ int lcg_globals_id;
 static php_lcg_globals lcg_globals;
 #endif
 
-#if WIN32||WINNT
+#if PHP_WIN32
 #include <process.h>
 #endif
 
index 8f8cd487a7b3a71743f8d03db001b025f131b98f..6e7e0da8552b7b5b511d097af8930b8d1f1b949f 100644 (file)
 #include <sys/stat.h>
 #include <string.h>
 #if HAVE_PWD_H
-#if MSVC5
+#if PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
 #endif
 #endif
 #if HAVE_GRP_H
-#if MSVC5
+#if PHP_WIN32
 #include "win32/grp.h"
 #else
 #include <grp.h>
index d87861a6050f454191ed5070a4bcbd4661eff6a7..ebb20bf6601344ea59ac0b84b9034efb1f2b8a59 100644 (file)
 #include <ctype.h>
 #include <stdio.h>
 #include "php.h"
-#ifndef MSVC5
+#if !PHP_WIN32
 #include "build-defs.h"
 #endif
 #include "php_mail.h"
 #include "php_ini.h"
 
 #if HAVE_SENDMAIL
-#if MSVC5
+#if 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 MSVC5
+#if 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 MSVC5
+#if 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 MSVC5
+#if PHP_WIN32
        PUTS("Internal Sendmail support for Windows 4");
 #else
        php_printf("Path to sendmail: <tt>%s</tt>", INI_STR("sendmail_path"));
index 03c5e5648fd089526299a44803bae047aff1d99c..5b84070abbf75360c42e7bd0d72ff6c0690bce9f 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <stdio.h>
 #ifdef HAVE_GETTIMEOFDAY
-#if MSVC5
+#if PHP_WIN32
 #include "win32/time.h"
 #else
 #include <sys/time.h>
index 0db76aed6b130fc2ac67fd3fac5b9b6639a13478..230477216b79e24a83157db52709d149343edb28 100644 (file)
@@ -25,7 +25,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if MSVC5
+#if 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 MSVC5
+#if PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
index 9213600fdbc1918295861a770ffc7ff4e082af05..d232b3f086340f2523333b3924e6fc230e7e14d4 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #if HAVE_PWD_H
-#if MSVC5
+#if PHP_WIN32
 #include "win32/pwd.h"
 #else
 #include <pwd.h>
@@ -34,7 +34,7 @@
 #include <unistd.h>
 #endif
 #include <sys/stat.h>
-#if MSVC5
+#if PHP_WIN32
 #include <process.h>
 #endif
 
index 28aabf5e4fb45657fdbe9ff1ba269da3dc939661..ff1b2703508539b26c50b02aca8b8a38a2f0cc0e 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "php.h"
 
-#if WIN32||WINNT
+#if PHP_WIN32
 #include <malloc.h>
 #endif
 
@@ -36,7 +36,7 @@
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
-#ifdef WIN32
+#if PHP_WIN32
 # include "win32/time.h"
 #endif
 
index f3cd2bda12d2a227cd035263f8824d242baf36f7..a866d9c5ad6204b45e4191aaaeb526a738b84917 100644 (file)
@@ -471,14 +471,14 @@ PHP_FUNCTION(basename)
        ret = estrdup((*str)->value.str.val);
        c = ret + (*str)->value.str.len -1;     
        while (*c == '/'
-#ifdef MSVC5
+#if PHP_WIN32
                   || *c == '\\'
 #endif
                )
                c--;
        *(c + 1) = '\0';        
        if ((c = strrchr(ret, '/'))
-#ifdef MSVC5
+#if PHP_WIN32
                || (c = strrchr(ret, '\\'))
 #endif
                ) {
@@ -495,14 +495,14 @@ PHPAPI void php_dirname(char *str, int len) {
 
        c = str + len - 1;
        while (*c == '/'
-#ifdef MSVC5
+#if PHP_WIN32
                   || *c == '\\'
 #endif
                )
                c--; /* strip trailing slashes */
        *(c + 1) = '\0';
        if ((c = strrchr(str, '/'))
-#ifdef MSVC5
+#if PHP_WIN32
                || (c = strrchr(str, '\\'))
 #endif
                )
index bdbe2e690e4195f0c30b5cfb780fc51bca91436b..de25a5ecce797918f89f77f12e602299b89b7abc 100644 (file)
@@ -26,7 +26,7 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if MSVC5
+#if 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
-#ifndef MSVC5
+#if !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
-#ifndef MSVC5
+#if !PHP_WIN32
        SET_VAR_LONG("LOG_LOCAL0", LOG_LOCAL0);
        SET_VAR_LONG("LOG_LOCAL1", LOG_LOCAL1);
        SET_VAR_LONG("LOG_LOCAL2", LOG_LOCAL2);
index 348ade34fefa1ee54851e7e591df92f4059215b7..9e4200ab74aa03bc58515cd4897af9058342f1c7 100644 (file)
@@ -29,7 +29,7 @@
 #include <errno.h>
 
 #include <stdio.h>
-#if MSVC5
+#if 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 && !(WIN32|WINNT)
+#if HAVE_USLEEP && !(PHP_WIN32)
        if (!MORE_ENTROPY) {
                usleep(1);
        }