Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/GameEngine/Include/GameNetwork/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <errno.h>
#endif

#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock.h>
#include <io.h>
//#define close _close
Expand Down
16 changes: 8 additions & 8 deletions Core/GameEngine/Source/GameNetwork/udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Int UDP::Bind(UnsignedInt IP,UnsignedShort Port)
addr.sin_port=Port;
addr.sin_addr.s_addr=IP;
fd=socket(AF_INET,SOCK_DGRAM,DEFAULT_PROTOCOL);
#ifdef _WINDOWS
#ifdef _WIN32
if (fd==SOCKET_ERROR)
fd=-1;
#endif
Expand All @@ -163,7 +163,7 @@ Int UDP::Bind(UnsignedInt IP,UnsignedShort Port)

retval=bind(fd,(struct sockaddr *)&addr,sizeof(addr));

#ifdef _WINDOWS
#ifdef _WIN32
if (retval==SOCKET_ERROR)
{
retval=-1;
Expand Down Expand Up @@ -201,7 +201,7 @@ Int UDP::getLocalAddr(UnsignedInt &ip, UnsignedShort &port)
// private function
Int UDP::SetBlocking(Int block)
{
#ifdef _WINDOWS
#ifdef _WIN32
unsigned long flag=1;
if (block)
flag=0;
Expand Down Expand Up @@ -244,7 +244,7 @@ Int UDP::Write(const unsigned char *msg,UnsignedInt len,UnsignedInt IP,UnsignedS

ClearStatus();
retval=sendto(fd,(const char *)msg,len,0,(struct sockaddr *)&to,sizeof(to));
#ifdef _WINDOWS
#ifdef _WIN32
if (retval==SOCKET_ERROR)
{
retval=-1;
Expand All @@ -267,7 +267,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from)
if (from!=NULL)
{
retval=recvfrom(fd,(char *)msg,len,0,(struct sockaddr *)from,&alen);
#ifdef _WINDOWS
#ifdef _WIN32
if (retval == SOCKET_ERROR)
{
if (WSAGetLastError() != WSAEWOULDBLOCK)
Expand All @@ -288,7 +288,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from)
else
{
retval=recvfrom(fd,(char *)msg,len,0,NULL,NULL);
#ifdef _WINDOWS
#ifdef _WIN32
if (retval==SOCKET_ERROR)
{
if (WSAGetLastError() != WSAEWOULDBLOCK)
Expand All @@ -312,7 +312,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from)

void UDP::ClearStatus(void)
{
#ifndef _WINDOWS
#ifndef _WIN32
errno=0;
#endif

Expand All @@ -322,7 +322,7 @@ void UDP::ClearStatus(void)
UDP::sockStat UDP::GetStatus(void)
{
Int status = m_lastError;
#ifdef _WINDOWS
#ifdef _WIN32
//int status=WSAGetLastError();
switch (status) {
case NO_ERROR:
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/ini.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ void INIClass::DuplicateCRCError(const char *message, const char *section, const
assert(0);

#ifdef RTS_RELEASE
#ifdef _WINDOWS
#ifdef _WIN32
MessageBox(0, buffer, "Duplicate CRC in INI file.", MB_ICONSTOP | MB_OK);
#endif
#endif
Expand Down
6 changes: 3 additions & 3 deletions Core/Tools/WW3D/pluglib/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#pragma warning(pop)
#endif

#ifdef _WINDOWS
#ifdef _WIN32
extern HINSTANCE ProgramInstance;
extern HWND MainWindow;
extern bool GameInFocus;
Expand All @@ -80,6 +80,6 @@ void __cdecl Print_Win32Error(unsigned long win32Error);

#endif // RTS_DEBUG

#else // _WINDOWS
#else // _WIN32
#include <unistd.h>
#endif // _WINDOWS
#endif // _WIN32
2 changes: 1 addition & 1 deletion Core/Tools/mangler/crc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


#include <signal.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <process.h> // *MUST* be included before ANY Wnet/Wlib headers if _REENTRANT is defined
#endif

Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/mangler/mangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <Utility/iostream_adapter.h>

#include <signal.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <process.h> // *MUST* be included before ANY Wnet/Wlib headers if _REENTRANT is defined
#endif

Expand Down Expand Up @@ -97,7 +97,7 @@ int main(int argc, char **argv)


// ----- Initialize Winsock -----
#ifdef _WINDOWS
#ifdef _WIN32
WORD verReq = MAKEWORD(2, 2);
WSADATA wsadata;

Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/mangler/manglertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <Utility/iostream_adapter.h>

#include <signal.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <process.h> // *MUST* be included before ANY Wnet/Wlib headers if _REENTRANT is defined
#endif

Expand Down Expand Up @@ -128,7 +128,7 @@ int main(int argc, char **argv)


// ----- Initialize Winsock -----
#ifdef _WINDOWS
#ifdef _WIN32
WORD verReq = MAKEWORD(2, 2);
WSADATA wsadata;

Expand Down
16 changes: 8 additions & 8 deletions Core/Tools/mangler/wlib/sem4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This is useful because the constructor will automatically call sem_init

Sem4::Sem4()
{
#ifndef _WINDOWS
#ifndef _WIN32
sem_init(&sem,1,1);
#else
sem = CreateSemaphore(NULL, 1, 1, NULL);
Expand All @@ -40,7 +40,7 @@ Sem4::Sem4()

Sem4::Sem4(uint32 value)
{
#ifndef _WINDOWS
#ifndef _WIN32
sem_init(&sem,1,value);
#else
sem = CreateSemaphore(NULL, value, value, NULL);
Expand All @@ -49,7 +49,7 @@ Sem4::Sem4(uint32 value)

Sem4::~Sem4()
{
#ifndef _WINDOWS
#ifndef _WIN32
sem_destroy(&sem);
#else
if (sem) CloseHandle(sem);
Expand All @@ -58,7 +58,7 @@ Sem4::~Sem4()

sint32 Sem4::Wait(void) const
{
#ifndef _WINDOWS
#ifndef _WIN32
return(sem_wait((sem_t *)&sem));
#else
if (!sem)
Expand All @@ -79,7 +79,7 @@ sint32 Sem4::Wait(void) const

sint32 Sem4::Post(void) const
{
#ifndef _WINDOWS
#ifndef _WIN32
return(sem_post((sem_t *)&sem));
#else
if (!sem)
Expand All @@ -92,7 +92,7 @@ sint32 Sem4::Post(void) const

sint32 Sem4::TryWait(void) const
{
#ifndef _WINDOWS
#ifndef _WIN32
return(sem_trywait((sem_t *)&sem));
#else
if (!sem)
Expand All @@ -112,7 +112,7 @@ sint32 Sem4::TryWait(void) const

sint32 Sem4::GetValue(int *sval) const
{
#ifndef _WINDOWS
#ifndef _WIN32
return(sem_getvalue((sem_t *)&sem,sval));
#else
if (!sem)
Expand All @@ -128,7 +128,7 @@ sint32 Sem4::GetValue(int *sval) const

sint32 Sem4::Destroy(void)
{
#ifndef _WINDOWS
#ifndef _WIN32
return(sem_destroy(&sem));
#else
return CloseHandle(sem);
Expand Down
8 changes: 4 additions & 4 deletions Core/Tools/mangler/wlib/sem4.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
#pragma once

#include <limits.h>
#ifndef _WINDOWS
#ifndef _WIN32
#include <unistd.h>
#endif
#include "wstypes.h"

#ifdef _REENTRANT
#ifndef _WINDOWS
#ifndef _WIN32
#include <semaphore.h>
#else
#include <windows.h>
#endif // _WINDOWS
#endif // _WIN32
#endif // _REENTRANT

// Windows headers have a tendency to redefine IN
Expand All @@ -42,7 +42,7 @@ class Sem4
{
private:
#ifdef _REENTRANT
#ifndef _WINDOWS
#ifndef _WIN32
sem_t sem;
#else
HANDLE sem;
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/mangler/wlib/syslogd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

SyslogD::SyslogD(char *ident,int logopt,int facility,int _priority)
{
#ifndef _WINDOWS
#ifndef _WIN32
openlog(ident,logopt,facility);
priority=_priority;
#endif
}

int SyslogD::print(const char *str, int len)
{
#ifndef _WINDOWS
#ifndef _WIN32
char *temp_str=new char[len+1];
memset(temp_str,0,len+1);
strncpy(temp_str,str,len);
Expand Down
2 changes: 1 addition & 1 deletion Core/Tools/mangler/wlib/syslogd.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <stdlib.h>
#include <stdio.h>
#ifndef _WINDOWS
#ifndef _WIN32
#include <syslog.h>
#endif
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/mangler/wlib/timezone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
void GetTimezoneInfo(const char * &timezone_str, int &timezone_offset) {
timezone_str = "Unknown Timezone";
timezone_offset = 0;
#ifdef _WINDOWS
#ifdef _WIN32
struct _timeb wintime;
_ftime(&wintime);

Expand All @@ -37,7 +37,7 @@ void GetTimezoneInfo(const char * &timezone_str, int &timezone_offset) {
timezone_offset = wintime.timezone * 60; // its in minutes...

#endif
#ifndef _WINDOWS
#ifndef _WIN32
struct timeval unixtime;
struct timezone unixtzone;
gettimeofday(&unixtime,&unixtzone);
Expand Down
8 changes: 4 additions & 4 deletions Core/Tools/mangler/wlib/wdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ will you be ready to leave grasshopper.
#include <Utility/iostream_adapter.h>
#include <Utility/sstream_adapter.h>

#if !defined(_WINDOWS)
#if !defined(_WIN32)
// Windows headers have a tendency to redefine IN
#ifdef IN
#undef IN
Expand Down Expand Up @@ -183,7 +183,7 @@ extern CritSec DebugLibSemaphore;
#define DBG(X) X

// In Windows, send a copy to the debugger window
#ifdef _WINDOWS
#ifdef _WIN32

// Print a variable
#define PVAR(v) \
Expand Down Expand Up @@ -239,7 +239,7 @@ extern CritSec DebugLibSemaphore;
DEBUGUNLOCK; \
}

#else // _WINDOWS
#else // _WIN32

// Print a variable
#define PVAR(v) \
Expand Down Expand Up @@ -279,7 +279,7 @@ extern CritSec DebugLibSemaphore;
"]: " << ##X << endl; X \
DEBUGUNLOCK; \
}
#endif // _WINDOWS
#endif // _WIN32

#endif // DEBUG

Expand Down
6 changes: 3 additions & 3 deletions Core/Tools/mangler/wlib/wstypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ Standard type definitions for the sake of portability and readability.
// threadsafe.h otherwise they won't compile

#include <time.h>
#ifndef _WINDOWS
#ifndef _WIN32
#define _POSIX_C_SOURCE 199506L
#define _POSIX_PTHREAD_SEMANTICS
#define __EXTENSIONS__
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef _WINDOWS
#ifndef _WIN32
#include <unistd.h>
#include <sys/time.h>
#include <dirent.h>
Expand Down Expand Up @@ -109,7 +109,7 @@ typedef double float64;
#define MAX_SINT16 0x7FFF
#define MAX_SINT8 0x7F

#ifdef _WINDOWS
#ifdef _WIN32
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
8 changes: 4 additions & 4 deletions Core/Tools/mangler/wlib/wtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static const char *FULLMONTHS[]={"January","February","March","April","May","Jun
"July","August","September","October","November","December"};

// MDC: Windows doesn't provide a localtime_r, so make our own...
#ifdef _WINDOWS
#ifdef _WIN32
#ifdef _REENTRANT
#include "critsec.h"
static CritSec localtime_critsec;
Expand All @@ -54,7 +54,7 @@ static struct tm *localtime_r(const time_t *clockval, struct tm *res) {
#endif
return res;
}
#endif // _WINDOWS
#endif // _WIN32

Wtime::Wtime(void)
{
Expand Down Expand Up @@ -82,13 +82,13 @@ Wtime::~Wtime()
void Wtime::Update(void)
{
sign=POSITIVE;
#ifdef _WINDOWS
#ifdef _WIN32
struct _timeb wintime;
_ftime(&wintime);
sec=wintime.time;
usec=(wintime.millitm)*1000;
#endif
#ifndef _WINDOWS
#ifndef _WIN32
struct timeval unixtime;
struct timezone unixtzone;
gettimeofday(&unixtime,&unixtzone);
Expand Down
Loading
Loading