From bb4d36e69de4d23daf5da70b135ad46fa1805812 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 17 Nov 2012 19:27:50 -0500 Subject: [PATCH] Remove windoze include from hsThread.h --- Sources/Plasma/CoreLib/HeadSpin.h | 1 + Sources/Plasma/CoreLib/hsThread.h | 14 +++----------- Sources/Plasma/CoreLib/hsThread_Win.cpp | 18 +++++++++++++++--- .../FeatureLib/pfConsole/pfDispatchLog.cpp | 2 ++ .../FeatureLib/pfCrashHandler/plCrashCli.cpp | 1 - .../FeatureLib/pfCrashHandler/plCrashCli.h | 1 + .../pfCrashHandler/plCrash_Private.h | 1 + .../Plasma/PubUtilLib/plAudio/plEAXEffects.cpp | 5 ++++- .../PubUtilLib/plPhysX/plSimulationMgr.cpp | 2 +- 9 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index aaa03704..e032b5f6 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -82,6 +82,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com typedef HINSTANCE hsWindowInst; typedef HINSTANCE HMODULE; typedef long HRESULT; + typedef void* HANDLE; #else typedef int32_t* hsWindowHndl; typedef int32_t* hsWindowInst; diff --git a/Sources/Plasma/CoreLib/hsThread.h b/Sources/Plasma/CoreLib/hsThread.h index ffaebc3b..49d0da2c 100644 --- a/Sources/Plasma/CoreLib/hsThread.h +++ b/Sources/Plasma/CoreLib/hsThread.h @@ -46,9 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com typedef uint32_t hsMilliseconds; -#ifdef HS_BUILD_FOR_WIN32 -# include "hsWindows.h" -#elif defined(HS_BUILD_FOR_UNIX) +#ifdef HS_BUILD_FOR_UNIX #include #include // We can't wait with a timeout with semas @@ -64,7 +62,7 @@ class hsThread { public: #if HS_BUILD_FOR_WIN32 - typedef DWORD ThreadId; + typedef uint32_t ThreadId; #elif HS_BUILD_FOR_UNIX typedef pthread_t ThreadId; #endif @@ -88,7 +86,7 @@ public: virtual ~hsThread(); // calls Stop() #if HS_BUILD_FOR_WIN32 ThreadId GetThreadId() { return fThreadId; } - static ThreadId GetMyThreadId() { return GetCurrentThreadId(); } + static ThreadId GetMyThreadId(); #elif HS_BUILD_FOR_UNIX ThreadId GetThreadId() { return fPThread; } static ThreadId GetMyThreadId() { return pthread_self(); } @@ -204,13 +202,7 @@ public: class hsSleep { public: -#if HS_BUILD_FOR_UNIX static void Sleep(uint32_t millis); - -#elif HS_BUILD_FOR_WIN32 - static void Sleep(uint32_t millis) { ::Sleep(millis); } - -#endif }; ////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/CoreLib/hsThread_Win.cpp b/Sources/Plasma/CoreLib/hsThread_Win.cpp index bbb27eca..bb1b0aa1 100644 --- a/Sources/Plasma/CoreLib/hsThread_Win.cpp +++ b/Sources/Plasma/CoreLib/hsThread_Win.cpp @@ -40,9 +40,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "hsThread.h" +#include "hsWindows.h" +#include #include "hsExceptions.h" #include "hsMemory.h" @@ -79,6 +79,11 @@ hsThread::~hsThread() this->Stop(); } +hsThread::ThreadId hsThread::GetMyThreadId() +{ + return GetCurrentThreadId(); +} + void hsThread::Start() { if (fThreadH == nil) @@ -237,4 +242,11 @@ bool hsEvent::Wait(hsMilliseconds timeToWait) void hsEvent::Signal() { ::SetEvent(fEvent); -} \ No newline at end of file +} + +/////////////////////////////////////////////////////////////// + +void hsSleep::Sleep(uint32_t millis) +{ + ::Sleep(millis); +} diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp index ef3879a2..968f6599 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ + +#include "hsWindows.h" #include "hsTimer.h" #include "pfDispatchLog.h" #include "plStatusLog/plStatusLog.h" diff --git a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp index 881c761c..fc0fea95 100644 --- a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp +++ b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plCrashCli.h" #include "plCrash_Private.h" -#include "plString.h" #ifdef HS_BUILD_FOR_WIN32 diff --git a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.h b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.h index 0308a586..b51e8499 100644 --- a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.h +++ b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.h @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfCrashCli_h_ #include "HeadSpin.h" +#include "hsWindows.h" #include "plCrashBase.h" struct plCrashMemLink; diff --git a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h index 70e9ec33..4274234a 100644 --- a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h +++ b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfCrash_Private_h_ #include "HeadSpin.h" +#include "hsWindows.h" #define CRASH_NOTIFY_SUFFIX "CrashNotify" #define CRASH_HANDLE_SUFFIX "CrashHandled" diff --git a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp index e6d82682..5feb43ff 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp @@ -47,10 +47,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" +#include "hsWindows.h" #include "hsThread.h" + #ifndef EAX_SDK_AVAILABLE -#include "plEAXStructures.h" +# include "plEAXStructures.h" #endif + #include "plEAXEffects.h" #include "plAudioCore/plAudioCore.h" #include "plDSoundBuffer.h" diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp index 5a4b768e..aeb4ad17 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp @@ -402,7 +402,7 @@ bool plSimulationMgr::InitSimulation() if ( !plPXConvert::Validate() ) { #ifndef PLASMA_EXTERNAL_RELEASE - hsMessageBox("Ageia's PhysX or Plasma offsets have changed, need to rewrite conversion code.","PhysX Error",MB_OK); + hsMessageBox("Ageia's PhysX or Plasma offsets have changed, need to rewrite conversion code.","PhysX Error",hsMBoxOk); #endif return false; // client will handle this and ask user to install }