Browse Source

Merge pull request #583 from tdev/x64_basics

windows 64 bit basics
Thomas Fischer 11 years ago
parent
commit
29d7fe310d
33 changed files with 81 additions and 49 deletions
  1. 1 1
      Engine/source/T3D/physics/bullet/bt.h
  2. 1 1
      Engine/source/T3D/physics/physx/px.h
  3. 1 1
      Engine/source/T3D/physics/physx/pxPlugin.cpp
  4. 2 2
      Engine/source/cinterface/c_scripting.cpp
  5. 2 2
      Engine/source/cinterface/cinterface.cpp
  6. 1 1
      Engine/source/console/CMDscan.cpp
  7. 1 1
      Engine/source/console/CMDscan.l
  8. 5 5
      Engine/source/core/strings/stringFunctions.cpp
  9. 1 1
      Engine/source/core/strings/stringFunctions.h
  10. 1 1
      Engine/source/core/util/path.h
  11. 1 1
      Engine/source/core/util/str.cpp
  12. 1 1
      Engine/source/gfx/D3D9/gfxD3D9CardProfiler.cpp
  13. 2 2
      Engine/source/gfx/gfxDevice.cpp
  14. 1 1
      Engine/source/platform/input/event.cpp
  15. 1 1
      Engine/source/platform/input/razerHydra/razerHydraDevice.cpp
  16. 4 4
      Engine/source/platform/platformCPUCount.cpp
  17. 2 2
      Engine/source/platform/platformFileIO.cpp
  18. 1 1
      Engine/source/platform/platformNet.cpp
  19. 1 1
      Engine/source/platform/platformNetAsync.cpp
  20. 2 2
      Engine/source/platform/platformVolume.cpp
  21. 2 2
      Engine/source/platform/profiler.cpp
  22. 7 1
      Engine/source/platform/types.codewarrior.h
  23. 7 1
      Engine/source/platform/types.gcc.h
  24. 1 1
      Engine/source/platform/types.h
  25. 1 1
      Engine/source/platform/types.lint.h
  26. 15 5
      Engine/source/platform/types.visualc.h
  27. 6 1
      Engine/source/platform/types.win.h
  28. 5 0
      Engine/source/platform/typesWin32.h
  29. 1 1
      Engine/source/platformWin32/threads/thread.cpp
  30. 1 1
      Engine/source/sfx/fmod/sfxFMODDevice.h
  31. 1 1
      Engine/source/sfx/fmod/sfxFMODProvider.cpp
  32. 1 1
      Engine/source/windowManager/platformInterface.cpp
  33. 1 1
      Tools/dae2dts/source/main.cpp

+ 1 - 1
Engine/source/T3D/physics/bullet/bt.h

@@ -24,7 +24,7 @@
 #define _BULLET_H_
 #define _BULLET_H_
 
 
 // NOTE: We set these defines which bullet needs here.
 // NOTE: We set these defines which bullet needs here.
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
 #define WIN32
 #define WIN32
 #endif
 #endif
 
 

+ 1 - 1
Engine/source/T3D/physics/physx/px.h

@@ -46,7 +46,7 @@
    #define __APPLE__
    #define __APPLE__
 #elif defined(TORQUE_OS_LINUX) && !defined(LINUX)
 #elif defined(TORQUE_OS_LINUX) && !defined(LINUX)
    #define LINUX
    #define LINUX
-#elif defined(TORQUE_OS_WIN32) && !defined(WIN32)
+#elif defined(TORQUE_OS_WIN) && !defined(WIN32)
    #define WIN32
    #define WIN32
 #endif
 #endif
 
 

+ 1 - 1
Engine/source/T3D/physics/physx/pxPlugin.cpp

@@ -39,7 +39,7 @@ AFTER_MODULE_INIT( Sim )
 {
 {
    NamedFactory<PhysicsPlugin>::add( "PhysX", &PxPlugin::create );
    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 );
       NamedFactory<PhysicsPlugin>::add( "default", &PxPlugin::create );
    #endif   
    #endif   
 
 

+ 2 - 2
Engine/source/cinterface/c_scripting.cpp

@@ -29,7 +29,7 @@
 
 
 // External scripting cinterface, suitable for import into any scripting system which support "C" interfaces (C#, Python, Lua, Java, etc)
 // 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/win32Window.h"
 #include "windowManager/win32/winDispatch.h"
 #include "windowManager/win32/winDispatch.h"
 #endif
 #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)
    void script_input_event(int type, int value1, int value2)
    {
    {

+ 2 - 2
Engine/source/cinterface/cinterface.cpp

@@ -29,7 +29,7 @@
 #include "windowManager/platformWindow.h"
 #include "windowManager/platformWindow.h"
 #include "windowManager/platformWindowMgr.h"
 #include "windowManager/platformWindowMgr.h"
 
 
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
 #include "windowManager/win32/win32Window.h"
 #include "windowManager/win32/win32Window.h"
 #include "windowManager/win32/winDispatch.h"
 #include "windowManager/win32/winDispatch.h"
 extern void createFontInit(void);
 extern void createFontInit(void);
@@ -415,7 +415,7 @@ extern "C" {
 			PlatformWindowManager::get()->getFirstWindow()->setSize(Point2I(width,height));
 			PlatformWindowManager::get()->getFirstWindow()->setSize(Point2I(width,height));
 	}
 	}
 
 
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
    // retrieve the hwnd of our render window
    // retrieve the hwnd of our render window
    void* torque_gethwnd()
    void* torque_gethwnd()
    {
    {

+ 1 - 1
Engine/source/console/CMDscan.cpp

@@ -2354,7 +2354,7 @@ void CMDerror(char *format, ...)
    char tempBuf[BUFMAX];
    char tempBuf[BUFMAX];
    va_list args;
    va_list args;
    va_start( args, format );
    va_start( args, format );
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
    _vsnprintf( tempBuf, BUFMAX, format, args );
    _vsnprintf( tempBuf, BUFMAX, format, args );
 #else
 #else
    vsnprintf( tempBuf, BUFMAX, format, args );
    vsnprintf( tempBuf, BUFMAX, format, args );

+ 1 - 1
Engine/source/console/CMDscan.l

@@ -245,7 +245,7 @@ void CMDerror(char *format, ...)
    char tempBuf[BUFMAX];
    char tempBuf[BUFMAX];
    va_list args;
    va_list args;
    va_start( args, format );
    va_start( args, format );
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
    _vsnprintf( tempBuf, BUFMAX, format, args );
    _vsnprintf( tempBuf, BUFMAX, format, args );
 #else
 #else
    vsnprintf( tempBuf, BUFMAX, format, args );
    vsnprintf( tempBuf, BUFMAX, format, args );

+ 5 - 5
Engine/source/core/strings/stringFunctions.cpp

@@ -27,7 +27,7 @@
 #include "platform/platform.h"
 #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...
 // This standard function is not defined when compiling with VC7...
 #define vsnprintf	_vsnprintf
 #define vsnprintf	_vsnprintf
 #endif
 #endif
@@ -330,7 +330,7 @@ char* dStrcpyl(char *dst, dsize_t dstSize, ...)
 
 
 int dStrcmp( const UTF16 *str1, const UTF16 *str2)
 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 ) );
    return wcscmp( reinterpret_cast<const wchar_t *>( str1 ), reinterpret_cast<const wchar_t *>( str2 ) );
 #else
 #else
    int ret;
    int ret;
@@ -347,7 +347,7 @@ int dStrcmp( const UTF16 *str1, const UTF16 *str2)
 
 
 char* dStrupr(char *str)
 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);
    return _strupr(str);
 #else
 #else
    if (str == NULL)
    if (str == NULL)
@@ -365,7 +365,7 @@ char* dStrupr(char *str)
 
 
 char* dStrlwr(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);
    return _strlwr(str);
 #else
 #else
    if (str == NULL)
    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, ...)
 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_list args;
    va_start(args, format);
    va_start(args, format);
 
 

+ 1 - 1
Engine/source/core/strings/stringFunctions.h

@@ -31,7 +31,7 @@
 #include "platform/types.h"
 #include "platform/types.h"
 #endif
 #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...
 // These standard functions are not defined on Win32 and other Microsoft platforms...
 #define strcasecmp   _stricmp
 #define strcasecmp   _stricmp
 #define strncasecmp  _strnicmp
 #define strncasecmp  _strnicmp

+ 1 - 1
Engine/source/core/util/path.h

@@ -40,7 +40,7 @@ class Path
 public:
 public:
    enum Separator
    enum Separator
    {
    {
-#if defined(TORQUE_OS_WIN32) || defined(TORQUE_OS_XENON)
+#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XENON)
       OsSeparator = '\\'
       OsSeparator = '\\'
 #else
 #else
       OsSeparator = '/'
       OsSeparator = '/'

+ 1 - 1
Engine/source/core/util/str.cpp

@@ -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...
 // This standard function is not defined when compiling with VC7...
 #define vsnprintf	_vsnprintf
 #define vsnprintf	_vsnprintf
 #endif
 #endif

+ 1 - 1
Engine/source/gfx/D3D9/gfxD3D9CardProfiler.cpp

@@ -25,7 +25,7 @@
 #include "gfx/primBuilder.h"
 #include "gfx/primBuilder.h"
 #include "gfx/D3D9/gfxD3D9CardProfiler.h"
 #include "gfx/D3D9/gfxD3D9CardProfiler.h"
 #include "gfx/D3D9/gfxD3D9EnumTranslate.h"
 #include "gfx/D3D9/gfxD3D9EnumTranslate.h"
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
 #include "platformWin32/videoInfo/wmiVideoInfo.h"
 #include "platformWin32/videoInfo/wmiVideoInfo.h"
 #endif
 #endif
 
 

+ 2 - 2
Engine/source/gfx/gfxDevice.cpp

@@ -184,8 +184,8 @@ GFXDevice::GFXDevice()
    // Add a few system wide shader macros.
    // Add a few system wide shader macros.
    GFXShader::addGlobalMacro( "TORQUE", "1" );
    GFXShader::addGlobalMacro( "TORQUE", "1" );
    GFXShader::addGlobalMacro( "TORQUE_VERSION", String::ToString(getVersionNumber()) );
    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
    #elif defined TORQUE_OS_MAC
       GFXShader::addGlobalMacro( "TORQUE_OS_MAC" );
       GFXShader::addGlobalMacro( "TORQUE_OS_MAC" );
    #elif defined TORQUE_OS_LINUX
    #elif defined TORQUE_OS_LINUX

+ 1 - 1
Engine/source/platform/input/event.cpp

@@ -381,7 +381,7 @@ CodeMapping gVirtualMap[] =
    { "lpov2",         SI_POV,    SI_LPOV2       },
    { "lpov2",         SI_POV,    SI_LPOV2       },
    { "rpov2",         SI_POV,    SI_RPOV2       },
    { "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
    //-------------------------------------- XINPUT EVENTS
    // Controller connect / disconnect:
    // Controller connect / disconnect:
    { "connect",       SI_BUTTON, XI_CONNECT     },
    { "connect",       SI_BUTTON, XI_CONNECT     },

+ 1 - 1
Engine/source/platform/input/razerHydra/razerHydraDevice.cpp

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

+ 4 - 4
Engine/source/platform/platformCPUCount.cpp

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

+ 2 - 2
Engine/source/platform/platformFileIO.cpp

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

+ 1 - 1
Engine/source/platform/platformNet.cpp

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

+ 1 - 1
Engine/source/platform/platformNetAsync.cpp

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

+ 2 - 2
Engine/source/platform/platformVolume.cpp

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

+ 2 - 2
Engine/source/platform/profiler.cpp

@@ -22,7 +22,7 @@
 
 
 #include "platform/platform.h"
 #include "platform/platform.h"
 
 
-#if defined(TORQUE_OS_WIN32)
+#if defined(TORQUE_OS_WIN)
 #include<Windows.h> // for SetThreadAffinityMask
 #include<Windows.h> // for SetThreadAffinityMask
 #endif
 #endif
 
 
@@ -462,7 +462,7 @@ void Profiler::hashPop(ProfilerRootData *expected)
       if(!mEnabled && mNextEnable)
       if(!mEnabled && mNextEnable)
          startHighResolutionTimer(mCurrentProfilerData->mStartTime);
          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
       // 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.
       // processors. When the profiler is enabled, we restrict Torque to a single processor.
       if(mNextEnable != mEnabled)
       if(mNextEnable != mEnabled)

+ 7 - 1
Engine/source/platform/types.codewarrior.h

@@ -51,10 +51,16 @@ typedef unsigned long long U64;     ///< Compiler independent Unsigned 64-bit in
 
 
 //--------------------------------------
 //--------------------------------------
 // Identify the Operating System
 // 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)
 #if defined(_WIN32)
 #  define TORQUE_OS_STRING "Win32"
 #  define TORQUE_OS_STRING "Win32"
+#  define TORQUE_OS_WIN
 #  define TORQUE_OS_WIN32
 #  define TORQUE_OS_WIN32
-#  include "platform/types.win32.h"
+#  include "platform/types.win.h"
 
 
 #elif defined(macintosh) || defined(__APPLE__)
 #elif defined(macintosh) || defined(__APPLE__)
 #  define TORQUE_OS_STRING "Mac"
 #  define TORQUE_OS_STRING "Mac"

+ 7 - 1
Engine/source/platform/types.gcc.h

@@ -55,12 +55,18 @@ typedef unsigned long long  U64;
 
 
 //--------------------------------------
 //--------------------------------------
 // Identify the Operating System
 // 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)
 #if defined(__WIN32__) || defined(_WIN32)
 #  define TORQUE_OS_STRING "Win32"
 #  define TORQUE_OS_STRING "Win32"
+#  define TORQUE_OS_WIN
 #  define TORQUE_OS_WIN32
 #  define TORQUE_OS_WIN32
 #  define TORQUE_SUPPORTS_NASM
 #  define TORQUE_SUPPORTS_NASM
 #  define TORQUE_SUPPORTS_GCC_INLINE_X86_ASM
 #  define TORQUE_SUPPORTS_GCC_INLINE_X86_ASM
-#  include "platform/types.win32.h"
+#  include "platform/types.win.h"
 
 
 #elif defined(SN_TARGET_PS3)
 #elif defined(SN_TARGET_PS3)
 #  define TORQUE_OS_STRING "PS3"
 #  define TORQUE_OS_STRING "PS3"

+ 1 - 1
Engine/source/platform/types.h

@@ -290,7 +290,7 @@ inline double getMax(double a, double b)
 
 
 #define BIT(x) (1 << (x))                       ///< Returns value with bit x set (2^x)
 #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
 #define STDCALL __stdcall
 #else
 #else
 #define STDCALL
 #define STDCALL

+ 1 - 1
Engine/source/platform/types.lint.h

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

+ 15 - 5
Engine/source/platform/types.visualc.h

@@ -58,11 +58,17 @@ typedef unsigned _int64 U64;
 #elif defined( _XBOX_VER )
 #elif defined( _XBOX_VER )
 #  define TORQUE_OS_STRING "Xbox"
 #  define TORQUE_OS_STRING "Xbox"
 #  define TORQUE_OS_XBOX
 #  define TORQUE_OS_XBOX
-#  include "platform/types.win32.h"
-#elif defined(_WIN32)
+#  include "platform/types.win.h"
+#elif defined( _WIN32 )
 #  define TORQUE_OS_STRING "Win32"
 #  define TORQUE_OS_STRING "Win32"
+#  define TORQUE_OS_WIN
 #  define TORQUE_OS_WIN32
 #  define TORQUE_OS_WIN32
-#  include "platform/types.win32.h"
+#  include "platform/types.win.h"
+#elif defined( _WIN64 )
+#  define TORQUE_OS_STRING "Win64"
+#  define TORQUE_OS_WIN
+#  define TORQUE_OS_WIN64
+#  include "platform/types.win.h"
 #else 
 #else 
 #  error "VC: Unsupported Operating System"
 #  error "VC: Unsupported Operating System"
 #endif
 #endif
@@ -70,13 +76,17 @@ typedef unsigned _int64 U64;
 
 
 //--------------------------------------
 //--------------------------------------
 // Identify the CPU
 // Identify the CPU
-#if defined(_M_IX86)
+#if defined( _M_X64 )
+#  define TORQUE_CPU_STRING "x64"
+#  define TORQUE_CPU_X64
+#  define TORQUE_LITTLE_ENDIAN
+#elif defined( _M_IX86 )
 #  define TORQUE_CPU_STRING "x86"
 #  define TORQUE_CPU_STRING "x86"
 #  define TORQUE_CPU_X86
 #  define TORQUE_CPU_X86
 #  define TORQUE_LITTLE_ENDIAN
 #  define TORQUE_LITTLE_ENDIAN
 #  define TORQUE_SUPPORTS_NASM
 #  define TORQUE_SUPPORTS_NASM
 #  define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
 #  define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
-#elif defined(TORQUE_OS_XENON)
+#elif defined( TORQUE_OS_XENON )
 #  define TORQUE_CPU_STRING "ppc"
 #  define TORQUE_CPU_STRING "ppc"
 #  define TORQUE_CPU_PPC
 #  define TORQUE_CPU_PPC
 #  define TORQUE_BIG_ENDIAN
 #  define TORQUE_BIG_ENDIAN

+ 6 - 1
Engine/source/platform/types.win32.h → Engine/source/platform/types.win.h

@@ -29,7 +29,12 @@
 // size_t is needed to overload new
 // size_t is needed to overload new
 // size_t tends to be OS and compiler specific and may need to 
 // size_t tends to be OS and compiler specific and may need to 
 // be if/def'ed in the future
 // be if/def'ed in the future
-typedef unsigned int  dsize_t;      
+
+#ifdef _WIN64
+typedef unsigned long long  dsize_t;
+#else
+typedef unsigned int  dsize_t;
+#endif // _WIN64
 
 
 
 
 /// Platform dependent file date-time structure.  The definition of this structure
 /// Platform dependent file date-time structure.  The definition of this structure

+ 5 - 0
Engine/source/platform/typesWin32.h

@@ -76,7 +76,12 @@ typedef double             F64;     ///< Compiler independent 64-bit float
 // size_t is needed to overload new
 // size_t is needed to overload new
 // size_t tends to be OS and compiler specific and may need to
 // size_t tends to be OS and compiler specific and may need to
 // be if/def'ed in the future
 // be if/def'ed in the future
+
+#ifdef _WIN64
+typedef unsigned long long  dsize_t;
+#else
 typedef unsigned int  dsize_t;
 typedef unsigned int  dsize_t;
+#endif // _WIN64
 
 
 typedef const char* StringTableEntry;
 typedef const char* StringTableEntry;
 
 

+ 1 - 1
Engine/source/platformWin32/threads/thread.cpp

@@ -164,7 +164,7 @@ U32 Thread::getId()
 
 
 void Thread::_setName( const char* name )
 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
    // See http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
 
 

+ 1 - 1
Engine/source/sfx/fmod/sfxFMODDevice.h

@@ -59,7 +59,7 @@
 
 
 
 
 // This doesn't appear to exist in some contexts, so let's just add it.
 // 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
 #ifndef WINAPI
 #define WINAPI __stdcall
 #define WINAPI __stdcall
 #endif
 #endif

+ 1 - 1
Engine/source/sfx/fmod/sfxFMODProvider.cpp

@@ -169,7 +169,7 @@ void SFXFMODProvider::init()
    const char* pDllName; // plugin-based DLL
    const char* pDllName; // plugin-based DLL
    const char* eventDllName;
    const char* eventDllName;
    
    
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
    dllName = "fmodex.dll";
    dllName = "fmodex.dll";
    pDllName = "fmodexp.dll";
    pDllName = "fmodexp.dll";
    eventDllName = "fmod_event.dll";
    eventDllName = "fmod_event.dll";

+ 1 - 1
Engine/source/windowManager/platformInterface.cpp

@@ -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
 // Hack so we can get the HWND of the global window more easily - replacement
 // for the HWND that was in the platstate.
 // for the HWND that was in the platstate.
 #include "windowManager/win32/win32Window.h"
 #include "windowManager/win32/win32Window.h"

+ 1 - 1
Tools/dae2dts/source/main.cpp

@@ -31,7 +31,7 @@
 #include "ts/tsShape.h"
 #include "ts/tsShape.h"
 #include "ts/tsShapeConstruct.h"
 #include "ts/tsShapeConstruct.h"
 
 
-#ifdef TORQUE_OS_WIN32
+#ifdef TORQUE_OS_WIN
 #include "platformWin32/platformWin32.h"
 #include "platformWin32/platformWin32.h"
 #include "platformWin32/winConsole.h"
 #include "platformWin32/winConsole.h"
 #endif
 #endif