refactored platform precompiler variable: TORQUE_OS_WIN{32,64,}

This commit is contained in:
Thomas Fischer 2014-03-15 15:10:14 +01:00
parent 47a2cc165a
commit 6d8e0d7e25
31 changed files with 48 additions and 42 deletions

View file

@ -381,7 +381,7 @@ CodeMapping gVirtualMap[] =
{ "lpov2", SI_POV, SI_LPOV2 },
{ "rpov2", SI_POV, SI_RPOV2 },
#if defined( TORQUE_OS_WIN32 ) || defined( TORQUE_OS_XENON )
#if defined( TORQUE_OS_WIN ) || defined( TORQUE_OS_XENON )
//-------------------------------------- XINPUT EVENTS
// Controller connect / disconnect:
{ "connect", SI_BUTTON, XI_CONNECT },

View file

@ -260,7 +260,7 @@ bool RazerHydraDevice::enable()
#endif
const char* dllName;
#ifdef TORQUE_OS_WIN32
#ifdef TORQUE_OS_WIN
#ifdef TORQUE_DEBUG
dllName = "sixensed.dll";
#else

View file

@ -53,7 +53,7 @@ EConfig CPUCount(U32& TotAvailLogical, U32& TotAvailCore, U32& PhysicalNum)
#include <string.h>
#include <sched.h>
#define DWORD unsigned long
#elif defined( TORQUE_OS_WIN32 )
#elif defined( TORQUE_OS_WIN )
#include <windows.h>
#elif defined( TORQUE_OS_MAC )
# include <sys/types.h>
@ -476,7 +476,7 @@ next:
if ( CPU_ISSET(i, &allowedCPUs) == 0 )
return CONFIG_UserConfigIssue;
}
#elif defined( TORQUE_OS_WIN32 )
#elif defined( TORQUE_OS_WIN )
DWORD dwProcessAffinity, dwSystemAffinity;
GetProcessAffinityMask(GetCurrentProcess(),
&dwProcessAffinity,
@ -504,7 +504,7 @@ next:
if ( sched_setaffinity (0, sizeof(currentCPU), &currentCPU) == 0 )
{
sleep(0); // Ensure system to switch to the right CPU
#elif defined( TORQUE_OS_WIN32 )
#elif defined( TORQUE_OS_WIN )
while (dwAffinityMask && dwAffinityMask <= dwSystemAffinity)
{
if (SetThreadAffinityMask(GetCurrentThread(), dwAffinityMask))
@ -549,7 +549,7 @@ next:
#ifdef TORQUE_OS_LINUX
sched_setaffinity (0, sizeof(allowedCPUs), &allowedCPUs);
sleep(0);
#elif defined( TORQUE_OS_WIN32 )
#elif defined( TORQUE_OS_WIN )
SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinity);
Sleep(0);
#else

View file

@ -140,7 +140,7 @@ inline void catPath(char *dst, const char *src, U32 len)
// converts the posix root path "/" to "c:/" for win32
// FIXME: this is not ideal. the c: drive is not guaranteed to exist.
#if defined(TORQUE_OS_WIN32)
#if defined(TORQUE_OS_WIN)
static inline void _resolveLeadingSlash(char* buf, U32 size)
{
if(buf[0] != '/')
@ -227,7 +227,7 @@ char * Platform::makeFullPathName(const char *path, char *buffer, U32 size, cons
if(Platform::isFullPath(bspath))
{
// Already a full path
#if defined(TORQUE_OS_WIN32)
#if defined(TORQUE_OS_WIN)
_resolveLeadingSlash(bspath, sizeof(bspath));
#endif
dStrncpy(buffer, bspath, size);

View file

@ -23,7 +23,7 @@
#include "platform/platformNet.h"
#include "core/strings/stringFunctions.h"
#if defined (TORQUE_OS_WIN32)
#if defined (TORQUE_OS_WIN)
#define TORQUE_USE_WINSOCK
#include <errno.h>
#include <winsock.h>

View file

@ -25,7 +25,7 @@
#include "platform/threads/threadPool.h"
#include "console/console.h"
#if defined(TORQUE_OS_WIN32)
#if defined(TORQUE_OS_WIN)
# include <winsock.h>
#elif defined(TORQUE_OS_XENON)
# include <Xtl.h>

View file

@ -22,7 +22,7 @@
#include "platform/platform.h"
#if defined(TORQUE_OS_WIN32) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
#include <sys/utime.h>
#else
#include <sys/time.h>
@ -84,7 +84,7 @@ bool MountZips(const String &root)
bool Touch( const Path &path )
{
#if defined(TORQUE_OS_WIN32) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
return( utime( path.getFullPath(), 0 ) != -1 );
#else
return( utimes( path.getFullPath(), NULL) == 0 ); // utimes returns 0 on success.

View file

@ -22,7 +22,7 @@
#include "platform/platform.h"
#if defined(TORQUE_OS_WIN32)
#if defined(TORQUE_OS_WIN)
#include<Windows.h> // for SetThreadAffinityMask
#endif
@ -462,7 +462,7 @@ void Profiler::hashPop(ProfilerRootData *expected)
if(!mEnabled && mNextEnable)
startHighResolutionTimer(mCurrentProfilerData->mStartTime);
#if defined(TORQUE_OS_WIN32)
#if defined(TORQUE_OS_WIN)
// The high performance counters under win32 are unreliable when running on multiple
// processors. When the profiler is enabled, we restrict Torque to a single processor.
if(mNextEnable != mEnabled)

View file

@ -53,10 +53,12 @@ typedef unsigned long long U64; ///< Compiler independent Unsigned 64-bit in
// Identify the Operating System
#if defined(_WIN64)
# define TORQUE_OS_STRING "Win64"
# define TORQUE_OS_WIN
# define TORQUE_OS_WIN64
# include "platform/types.win.h"
#if defined(_WIN32)
# define TORQUE_OS_STRING "Win32"
# define TORQUE_OS_WIN
# define TORQUE_OS_WIN32
# include "platform/types.win.h"

View file

@ -57,10 +57,12 @@ typedef unsigned long long U64;
// Identify the Operating System
#if defined(_WIN64)
# define TORQUE_OS_STRING "Win64"
# define TORQUE_OS_WIN
# define TORQUE_OS_WIN64
# include "platform/types.win.h"
#if defined(__WIN32__) || defined(_WIN32)
# define TORQUE_OS_STRING "Win32"
# define TORQUE_OS_WIN
# define TORQUE_OS_WIN32
# define TORQUE_SUPPORTS_NASM
# define TORQUE_SUPPORTS_GCC_INLINE_X86_ASM

View file

@ -290,7 +290,7 @@ inline double getMax(double a, double b)
#define BIT(x) (1 << (x)) ///< Returns value with bit x set (2^x)
#if defined(TORQUE_OS_WIN32)
#if defined(TORQUE_OS_WIN)
#define STDCALL __stdcall
#else
#define STDCALL

View file

@ -39,7 +39,7 @@ struct FileTime
#define TORQUE_LITTLE_ENDIAN
#define TORQUE_SUPPORTS_NASM
#define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
#define TORQUE_OS_WIN32
#define TORQUE_OS_WIN
#define TORQUE_COMPILER_VISUALC 1500
#ifndef FN_CDECL

View file

@ -61,12 +61,14 @@ typedef unsigned _int64 U64;
# include "platform/types.win.h"
#elif defined( _WIN32 )
# define TORQUE_OS_STRING "Win32"
# define TORQUE_OS_WIN
# define TORQUE_OS_WIN32
# include "platform/types.win.h"
#elif defined( _WIN64 )
# define TORQUE_OS_STRING "Win64"
# define TORQUE_OS_WIN
# define TORQUE_OS_WIN64
# include "platform/types.win32.h"
# include "platform/types.win.h"
#else
# error "VC: Unsupported Operating System"
#endif