mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
refactored platform precompiler variable: TORQUE_OS_WIN{32,64,}
This commit is contained in:
parent
47a2cc165a
commit
6d8e0d7e25
|
|
@ -24,7 +24,7 @@
|
|||
#define _BULLET_H_
|
||||
|
||||
// NOTE: We set these defines which bullet needs here.
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#define __APPLE__
|
||||
#elif defined(TORQUE_OS_LINUX) && !defined(LINUX)
|
||||
#define LINUX
|
||||
#elif defined(TORQUE_OS_WIN32) && !defined(WIN32)
|
||||
#elif defined(TORQUE_OS_WIN) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ AFTER_MODULE_INIT( Sim )
|
|||
{
|
||||
NamedFactory<PhysicsPlugin>::add( "PhysX", &PxPlugin::create );
|
||||
|
||||
#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)
|
||||
NamedFactory<PhysicsPlugin>::add( "default", &PxPlugin::create );
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
// External scripting cinterface, suitable for import into any scripting system which support "C" interfaces (C#, Python, Lua, Java, etc)
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
#include "windowManager/win32/win32Window.h"
|
||||
#include "windowManager/win32/winDispatch.h"
|
||||
#endif
|
||||
|
|
@ -383,7 +383,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
|
||||
void script_input_event(int type, int value1, int value2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "windowManager/platformWindow.h"
|
||||
#include "windowManager/platformWindowMgr.h"
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
#include "windowManager/win32/win32Window.h"
|
||||
#include "windowManager/win32/winDispatch.h"
|
||||
extern void createFontInit(void);
|
||||
|
|
@ -415,7 +415,7 @@ extern "C" {
|
|||
PlatformWindowManager::get()->getFirstWindow()->setSize(Point2I(width,height));
|
||||
}
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
// retrieve the hwnd of our render window
|
||||
void* torque_gethwnd()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2355,7 +2355,7 @@ void CMDerror(char *format, ...)
|
|||
char tempBuf[BUFMAX];
|
||||
va_list args;
|
||||
va_start( args, format );
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
_vsnprintf( tempBuf, BUFMAX, format, args );
|
||||
#else
|
||||
vsnprintf( tempBuf, BUFMAX, format, args );
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ void CMDerror(char *format, ...)
|
|||
char tempBuf[BUFMAX];
|
||||
va_list args;
|
||||
va_start( args, format );
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
_vsnprintf( tempBuf, BUFMAX, format, args );
|
||||
#else
|
||||
vsnprintf( tempBuf, BUFMAX, format, args );
|
||||
|
|
|
|||
|
|
@ -27,7 +27,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)
|
||||
// This standard function is not defined when compiling with VC7...
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
|
@ -330,7 +330,7 @@ char* dStrcpyl(char *dst, dsize_t dstSize, ...)
|
|||
|
||||
int dStrcmp( const UTF16 *str1, const UTF16 *str2)
|
||||
{
|
||||
#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 wcscmp( reinterpret_cast<const wchar_t *>( str1 ), reinterpret_cast<const wchar_t *>( str2 ) );
|
||||
#else
|
||||
int ret;
|
||||
|
|
@ -347,7 +347,7 @@ int dStrcmp( const UTF16 *str1, const UTF16 *str2)
|
|||
|
||||
char* dStrupr(char *str)
|
||||
{
|
||||
#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 _strupr(str);
|
||||
#else
|
||||
if (str == NULL)
|
||||
|
|
@ -365,7 +365,7 @@ char* dStrupr(char *str)
|
|||
|
||||
char* dStrlwr(char *str)
|
||||
{
|
||||
#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 _strlwr(str);
|
||||
#else
|
||||
if (str == NULL)
|
||||
|
|
@ -421,7 +421,7 @@ S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist)
|
|||
|
||||
S32 dSscanf(const char *buffer, const char *format, ...)
|
||||
{
|
||||
#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)
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "platform/types.h"
|
||||
#endif
|
||||
|
||||
#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)
|
||||
// These standard functions are not defined on Win32 and other Microsoft platforms...
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class Path
|
|||
public:
|
||||
enum Separator
|
||||
{
|
||||
#if defined(TORQUE_OS_WIN32) || defined(TORQUE_OS_XENON)
|
||||
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XENON)
|
||||
OsSeparator = '\\'
|
||||
#else
|
||||
OsSeparator = '/'
|
||||
|
|
|
|||
|
|
@ -1419,7 +1419,7 @@ void String::copy(StringChar* dst, const StringChar *src, U32 len)
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#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)
|
||||
// This standard function is not defined when compiling with VC7...
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include "gfx/primBuilder.h"
|
||||
#include "gfx/D3D9/gfxD3D9CardProfiler.h"
|
||||
#include "gfx/D3D9/gfxD3D9EnumTranslate.h"
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
#include "platformWin32/videoInfo/wmiVideoInfo.h"
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ GFXDevice::GFXDevice()
|
|||
// Add a few system wide shader macros.
|
||||
GFXShader::addGlobalMacro( "TORQUE", "1" );
|
||||
GFXShader::addGlobalMacro( "TORQUE_VERSION", String::ToString(getVersionNumber()) );
|
||||
#if defined TORQUE_OS_WIN32
|
||||
GFXShader::addGlobalMacro( "TORQUE_OS_WIN32" );
|
||||
#if defined TORQUE_OS_WIN
|
||||
GFXShader::addGlobalMacro( "TORQUE_OS_WIN" );
|
||||
#elif defined TORQUE_OS_MAC
|
||||
GFXShader::addGlobalMacro( "TORQUE_OS_MAC" );
|
||||
#elif defined TORQUE_OS_LINUX
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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), ¤tCPU) == 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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ U32 Thread::getId()
|
|||
|
||||
void Thread::_setName( const char* name )
|
||||
{
|
||||
#if defined( TORQUE_DEBUG ) && defined( TORQUE_COMPILER_VISUALC ) && defined( TORQUE_OS_WIN32 )
|
||||
#if defined( TORQUE_DEBUG ) && defined( TORQUE_COMPILER_VISUALC ) && defined( TORQUE_OS_WIN )
|
||||
|
||||
// See http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
|
||||
// This doesn't appear to exist in some contexts, so let's just add it.
|
||||
#if defined(TORQUE_OS_WIN32) || defined(TORQUE_OS_XENON)
|
||||
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XENON)
|
||||
#ifndef WINAPI
|
||||
#define WINAPI __stdcall
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void SFXFMODProvider::init()
|
|||
const char* pDllName; // plugin-based DLL
|
||||
const char* eventDllName;
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
dllName = "fmodex.dll";
|
||||
pDllName = "fmodexp.dll";
|
||||
eventDllName = "fmod_event.dll";
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ void Platform::closeWindow()
|
|||
|
||||
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
// Hack so we can get the HWND of the global window more easily - replacement
|
||||
// for the HWND that was in the platstate.
|
||||
#include "windowManager/win32/win32Window.h"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "ts/tsShape.h"
|
||||
#include "ts/tsShapeConstruct.h"
|
||||
|
||||
#ifdef TORQUE_OS_WIN32
|
||||
#ifdef TORQUE_OS_WIN
|
||||
#include "platformWin32/platformWin32.h"
|
||||
#include "platformWin32/winConsole.h"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue