cvs: php4 /ext/ftp/ ftp.c php_ftp.c
[email protected] ("Andi Gutmans")
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <cvsandi959089795@cvsserver> |
andi Tue May 23 15:49:55 2000 EDT
Modified files:
/php4/ext/ftp ftp.c php_ftp.c
Log:
- PHP_WIN32 macro should be used with #ifdef/#ifndef
- Always use PHP_WIN32 instead of WIN32/WINNT values
Index: php4/ext/ftp/ftp.c
diff -u php4/ext/ftp/ftp.c:1.20 php4/ext/ftp/ftp.c:1.21
--- php4/ext/ftp/ftp.c:1.20 Tue May 23 13:52:04 2000
+++ php4/ext/ftp/ftp.c Tue May 23 15:49:55 2000
@@ -28,7 +28,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.c,v 1.20 2000/05/23 11:52:04 fmk Exp $ */
+/* $Id: ftp.c,v 1.21 2000/05/23 13:49:55 andi Exp $ */
#include "php.h"
@@ -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 @@
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 @@
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 @@
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 @@
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: php4/ext/ftp/php_ftp.c
diff -u php4/ext/ftp/php_ftp.c:1.21 php4/ext/ftp/php_ftp.c:1.22
--- php4/ext/ftp/php_ftp.c:1.21 Tue May 23 10:05:22 2000
+++ php4/ext/ftp/php_ftp.c Tue May 23 15:49:55 2000
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.c,v 1.21 2000/05/23 08:05:22 fmk Exp $ */
+/* $Id: php_ftp.c,v 1.22 2000/05/23 13:49:55 andi Exp $ */
#include "php.h"
@@ -552,7 +552,7 @@
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 @@
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) {