#include <fcntl.h>
#include <string.h>
#include <time.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <winsock.h>
#else
#include <sys/socket.h>
#include "ftp.h"
/* define closesocket macro for portability */
-#if !PHP_WIN32
+#ifndef PHP_WIN32
#undef closesocket
#define closesocket close
#endif
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;
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;
int
my_connect(int s, const struct sockaddr *addr, int addrlen)
-#if !PHP_WIN32
+#ifndef PHP_WIN32
{
fd_set conn_set;
int flags;
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;
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) {
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) {