]> granicus.if.org Git - php/commitdiff
- PHP_WIN32 macro should be used with #ifdef/#ifndef
authorAndi Gutmans <andi@php.net>
Tue, 23 May 2000 13:49:55 +0000 (13:49 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 23 May 2000 13:49:55 +0000 (13:49 +0000)
- Always use PHP_WIN32 instead of WIN32/WINNT values

ext/ftp/ftp.c
ext/ftp/php_ftp.c

index 33ae7c927e059af5c9c75b33bf37fd10326f1891..5cafaea2a32ea992774574c2ad381dccfdc02697 100644 (file)
@@ -43,7 +43,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <time.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include <winsock.h>
 #else
 #include <sys/socket.h>
@@ -59,7 +59,7 @@
 #include "ftp.h"
 
 /* define closesocket macro for portability */
-#if !PHP_WIN32
+#ifndef PHP_WIN32
 #undef closesocket
 #define closesocket close
 #endif
@@ -843,7 +843,7 @@ my_send(int s, void *buf, size_t len)
                n = select(s + 1, NULL, &write_set, NULL, &tv);
                if (n < 1) {
                        if (n == 0)
-#if !PHP_WIN32
+#ifndef PHP_WIN32
                                errno = ETIMEDOUT;
 #endif
                        return -1;
@@ -876,7 +876,7 @@ my_recv(int s, void *buf, size_t len)
        n = select(s + 1, &read_set, NULL, NULL, &tv);
        if (n < 1) {
                if (n == 0)
-#if !PHP_WIN32
+#ifndef PHP_WIN32
                        errno = ETIMEDOUT;
 #endif
                return -1;
@@ -888,7 +888,7 @@ my_recv(int s, void *buf, size_t len)
 
 int
 my_connect(int s, const struct sockaddr *addr, int addrlen)
-#if !PHP_WIN32
+#ifndef PHP_WIN32
 {
        fd_set          conn_set;
        int             flags;
@@ -953,7 +953,7 @@ my_accept(int s, struct sockaddr *addr, int *addrlen)
        n = select(s + 1, &accept_set, NULL, NULL, &tv);
        if (n < 1) {
                if (n == 0)
-#if !PHP_WIN32
+#ifndef PHP_WIN32
                        errno = ETIMEDOUT;
 #endif
                return -1;
index 9770679430b244d74cf0769ee019921c49dbe097..aa7e6700ca5c06dc488375936f26dc2a9dbc8516 100644 (file)
@@ -552,7 +552,7 @@ PHP_FUNCTION(ftp_get)
                RETURN_FALSE;
        }
 
-#if defined(WIN32) || defined(WINNT)
+#ifdef PHP_WIN32
        if ((outfp = V_FOPEN(arg2->value.str.val, "wb")) == NULL) {
 #else
        if ((outfp = V_FOPEN(arg2->value.str.val, "w")) == NULL) {
@@ -640,7 +640,7 @@ PHP_FUNCTION(ftp_put)
        convert_to_string(arg3);
        XTYPE(xtype, arg4);
 
-#if defined(WIN32) || defined(WINNT)
+#ifdef PHP_WIN32
        if ((infp = V_FOPEN(arg3->value.str.val, "rb")) == NULL) {
 #else
        if ((infp = V_FOPEN(arg3->value.str.val, "r")) == NULL) {