Make buildable with GCC in Linux

* replace GetThreadID with std::this_thread.getId()
* name all anonymous structs and unions that contain non-trivially constructable objects
* made default constructor for big endian type noexcept to make it work with std::atomic
* move instantiated specialized template function members ouside of the class definition to comply with the standard
* added default instantiation for template parameter "=nullptr"
* used the C++11 standardized thread_local instead of the __declspec(thread)
* added transitional definitions to bridge the microsoft specific calls (compare and exchange and aligned alloc)
* removed cyclic dependency between Emulator->CPUThreadManager->CPUThread->SMutex->Emulator->...
* fixed some instances of indentation by space instead of tabs
* surrounded some unused code with an #if 0 block to make sure it doesn't compile
This commit is contained in:
Bigpet 2014-02-23 17:52:52 +01:00
parent 07135570f4
commit 9a30ce5f18
48 changed files with 190 additions and 154 deletions

View file

@ -1,7 +1,7 @@
#pragma once
extern void SM_Sleep();
extern DWORD SM_GetCurrentThreadId();
extern std::thread::id SM_GetCurrentThreadId();
extern u32 SM_GetCurrentCPUThreadId();
extern be_t<u32> SM_GetCurrentCPUThreadIdBE();
@ -22,7 +22,7 @@ template
typename T,
u32 free_value = 0,
u32 dead_value = ~0,
void (wait)() = SM_Sleep
void (*wait)() = SM_Sleep
>
class SMutexBase
{
@ -149,9 +149,9 @@ typedef SMutexBase<u32>
typedef SMutexBase<be_t<u32>>
SMutexBE;
typedef SMutexLockerBase<DWORD, SM_GetCurrentThreadId>
typedef SMutexLockerBase<std::thread::id, SM_GetCurrentThreadId>
SMutexGeneralLocker;
typedef SMutexLockerBase<u32, SM_GetCurrentCPUThreadId>
SMutexLocker;
typedef SMutexLockerBase<be_t<u32>, SM_GetCurrentCPUThreadIdBE>
SMutexBELocker;
SMutexBELocker;