diff options
| author | ntoskrnl <ntoskrnl11@yahoo.com> | 2012-07-29 16:14:14 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-02 14:21:16 (GMT) |
| commit | f94fabd999c304de958cc051e9625f169cec138f (patch) | |
| tree | 9ee58bc33bd745afa32b0d57b413cc7a555cd545 /src/client | |
| parent | 87dfc47c9785f834e61eef4545c503071d1665fc (diff) | |
| download | powder-f94fabd999c304de958cc051e9625f169cec138f.zip powder-f94fabd999c304de958cc051e9625f169cec138f.tar.gz | |
Rename WIN32 preprocessor definition to WIN
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/Client.cpp | 10 | ||||
| -rw-r--r-- | src/client/HTTP.cpp | 18 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 29f6a94..2684689 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -8,7 +8,7 @@ #include <stdio.h> #include <deque> -#ifdef WIN32 +#ifdef WIN #include <direct.h> #else #include <sys/stat.h> @@ -30,7 +30,7 @@ extern "C" { -#if defined(WIN32) && !defined(__GNUC__) +#if defined(WIN) && !defined(__GNUC__) #include <io.h> #else #include <dirent.h> @@ -136,7 +136,7 @@ std::vector<std::string> Client::DirectorySearch(std::string directory, std::str { //Get full file listing std::vector<std::string> directoryList; -#if defined(WIN32) && !defined(__GNUC__) +#if defined(WIN) && !defined(__GNUC__) //Windows struct _finddata_t currentFile; intptr_t findFileHandle; @@ -591,7 +591,7 @@ string Client::AddStamp(GameSave * saveData) << std::setw(8) << std::setfill('0') << std::hex << lastStampTime << std::setw(2) << std::setfill('0') << std::hex << lastStampName; -#ifdef WIN32 +#ifdef WIN _mkdir(STAMPS_DIR); #else mkdir(STAMPS_DIR, 0755); @@ -615,7 +615,7 @@ string Client::AddStamp(GameSave * saveData) void Client::updateStamps() { -#ifdef WIN32 +#ifdef WIN _mkdir(STAMPS_DIR); #else mkdir(STAMPS_DIR, 0755); diff --git a/src/client/HTTP.cpp b/src/client/HTTP.cpp index 686a6ee..43d5dcf 100644 --- a/src/client/HTTP.cpp +++ b/src/client/HTTP.cpp @@ -25,14 +25,14 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#ifndef WIN32 +#ifndef WIN #include <sys/param.h> #endif #if !defined(MACOSX) && !defined(BSD) #include <malloc.h> #endif #include <time.h> -#ifdef WIN32 +#ifdef WIN #define _WIN32_WINNT 0x0501 //#include <iphlpapi.h> #include <winsock2.h> @@ -52,7 +52,7 @@ #include "HTTP.h" #include "MD5.h" -#ifdef WIN32 +#ifdef WIN #define PERROR SOCKET_ERROR #define PERRNO WSAGetLastError() #define PEAGAIN WSAEWOULDBLOCK @@ -164,7 +164,7 @@ static int resolve(char *dns, char *srv, struct sockaddr_in *addr) void http_init(char *proxy) { char *host, *port; -#ifdef WIN32 +#ifdef WIN WSADATA wsadata; if (!WSAStartup(MAKEWORD(2,2), &wsadata)) http_up = 1; @@ -196,7 +196,7 @@ void http_init(char *proxy) void http_done(void) { -#ifdef WIN32 +#ifdef WIN WSACleanup(); #endif http_up = 0; @@ -413,7 +413,7 @@ int http_async_req_status(void *ctx) char *dns,*srv,buf[CHUNK]; int tmp, i; time_t now = time(NULL); -#ifdef WIN32 +#ifdef WIN unsigned long tmp2; #endif @@ -445,7 +445,7 @@ int http_async_req_status(void *ctx) if (cx->fd == PERROR) goto fail; cx->fdhost = mystrdup(cx->host); -#ifdef WIN32 +#ifdef WIN tmp2 = 1; if (ioctlsocket(cx->fd, FIONBIO, &tmp2) == SOCKET_ERROR) goto fail; @@ -459,7 +459,7 @@ int http_async_req_status(void *ctx) } if (!connect(cx->fd, (struct sockaddr *)&cx->addr, sizeof(cx->addr))) cx->state = HTS_IDLE; -#ifdef WIN32 +#ifdef WIN else if (PERRNO==WSAEISCONN) cx->state = HTS_IDLE; #endif @@ -468,7 +468,7 @@ int http_async_req_status(void *ctx) cx->state = HTS_IDLE; #endif else if (PERRNO!=PEINPROGRESS && PERRNO!=PEALREADY -#ifdef WIN32 +#ifdef WIN && PERRNO!=PEAGAIN && PERRNO!=WSAEINVAL #endif ) |
