Browse Source

Remove windoze include from hsThread.h

Adam Johnson 12 years ago
parent
commit
bb4d36e69d
  1. 1
      Sources/Plasma/CoreLib/HeadSpin.h
  2. 14
      Sources/Plasma/CoreLib/hsThread.h
  3. 18
      Sources/Plasma/CoreLib/hsThread_Win.cpp
  4. 2
      Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp
  5. 1
      Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp
  6. 1
      Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.h
  7. 1
      Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h
  8. 5
      Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp
  9. 2
      Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp

1
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 hsWindowInst;
typedef HINSTANCE HMODULE; typedef HINSTANCE HMODULE;
typedef long HRESULT; typedef long HRESULT;
typedef void* HANDLE;
#else #else
typedef int32_t* hsWindowHndl; typedef int32_t* hsWindowHndl;
typedef int32_t* hsWindowInst; typedef int32_t* hsWindowInst;

14
Sources/Plasma/CoreLib/hsThread.h

@ -46,9 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
typedef uint32_t hsMilliseconds; typedef uint32_t hsMilliseconds;
#ifdef HS_BUILD_FOR_WIN32 #ifdef HS_BUILD_FOR_UNIX
# include "hsWindows.h"
#elif defined(HS_BUILD_FOR_UNIX)
#include <pthread.h> #include <pthread.h>
#include <semaphore.h> #include <semaphore.h>
// We can't wait with a timeout with semas // We can't wait with a timeout with semas
@ -64,7 +62,7 @@ class hsThread
{ {
public: public:
#if HS_BUILD_FOR_WIN32 #if HS_BUILD_FOR_WIN32
typedef DWORD ThreadId; typedef uint32_t ThreadId;
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
typedef pthread_t ThreadId; typedef pthread_t ThreadId;
#endif #endif
@ -88,7 +86,7 @@ public:
virtual ~hsThread(); // calls Stop() virtual ~hsThread(); // calls Stop()
#if HS_BUILD_FOR_WIN32 #if HS_BUILD_FOR_WIN32
ThreadId GetThreadId() { return fThreadId; } ThreadId GetThreadId() { return fThreadId; }
static ThreadId GetMyThreadId() { return GetCurrentThreadId(); } static ThreadId GetMyThreadId();
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
ThreadId GetThreadId() { return fPThread; } ThreadId GetThreadId() { return fPThread; }
static ThreadId GetMyThreadId() { return pthread_self(); } static ThreadId GetMyThreadId() { return pthread_self(); }
@ -204,13 +202,7 @@ public:
class hsSleep class hsSleep
{ {
public: public:
#if HS_BUILD_FOR_UNIX
static void Sleep(uint32_t millis); static void Sleep(uint32_t millis);
#elif HS_BUILD_FOR_WIN32
static void Sleep(uint32_t millis) { ::Sleep(millis); }
#endif
}; };
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

18
Sources/Plasma/CoreLib/hsThread_Win.cpp

@ -40,9 +40,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <process.h>
#include "hsThread.h" #include "hsThread.h"
#include "hsWindows.h"
#include <process.h>
#include "hsExceptions.h" #include "hsExceptions.h"
#include "hsMemory.h" #include "hsMemory.h"
@ -79,6 +79,11 @@ hsThread::~hsThread()
this->Stop(); this->Stop();
} }
hsThread::ThreadId hsThread::GetMyThreadId()
{
return GetCurrentThreadId();
}
void hsThread::Start() void hsThread::Start()
{ {
if (fThreadH == nil) if (fThreadH == nil)
@ -237,4 +242,11 @@ bool hsEvent::Wait(hsMilliseconds timeToWait)
void hsEvent::Signal() void hsEvent::Signal()
{ {
::SetEvent(fEvent); ::SetEvent(fEvent);
} }
///////////////////////////////////////////////////////////////
void hsSleep::Sleep(uint32_t millis)
{
::Sleep(millis);
}

2
Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp

@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021 Mead, WA 99021
*==LICENSE==*/ *==LICENSE==*/
#include "hsWindows.h"
#include "hsTimer.h" #include "hsTimer.h"
#include "pfDispatchLog.h" #include "pfDispatchLog.h"
#include "plStatusLog/plStatusLog.h" #include "plStatusLog/plStatusLog.h"

1
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 "plCrashCli.h"
#include "plCrash_Private.h" #include "plCrash_Private.h"
#include "plString.h"
#ifdef HS_BUILD_FOR_WIN32 #ifdef HS_BUILD_FOR_WIN32

1
Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.h

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define _pfCrashCli_h_ #define _pfCrashCli_h_
#include "HeadSpin.h" #include "HeadSpin.h"
#include "hsWindows.h"
#include "plCrashBase.h" #include "plCrashBase.h"
struct plCrashMemLink; struct plCrashMemLink;

1
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_ #define _pfCrash_Private_h_
#include "HeadSpin.h" #include "HeadSpin.h"
#include "hsWindows.h"
#define CRASH_NOTIFY_SUFFIX "CrashNotify" #define CRASH_NOTIFY_SUFFIX "CrashNotify"
#define CRASH_HANDLE_SUFFIX "CrashHandled" #define CRASH_HANDLE_SUFFIX "CrashHandled"

5
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 "HeadSpin.h"
#include "hsWindows.h"
#include "hsThread.h" #include "hsThread.h"
#ifndef EAX_SDK_AVAILABLE #ifndef EAX_SDK_AVAILABLE
#include "plEAXStructures.h" # include "plEAXStructures.h"
#endif #endif
#include "plEAXEffects.h" #include "plEAXEffects.h"
#include "plAudioCore/plAudioCore.h" #include "plAudioCore/plAudioCore.h"
#include "plDSoundBuffer.h" #include "plDSoundBuffer.h"

2
Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp

@ -402,7 +402,7 @@ bool plSimulationMgr::InitSimulation()
if ( !plPXConvert::Validate() ) if ( !plPXConvert::Validate() )
{ {
#ifndef PLASMA_EXTERNAL_RELEASE #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 #endif
return false; // client will handle this and ask user to install return false; // client will handle this and ask user to install
} }

Loading…
Cancel
Save