mirror of https://github.com/mgba-emu/mgba.git
Vita, Wii: Build fixes
This commit is contained in:
parent
9b07a63056
commit
ba27062842
|
@ -17,7 +17,6 @@ typedef struct {
|
|||
} Condition;
|
||||
#define THREAD_ENTRY int
|
||||
typedef THREAD_ENTRY (*ThreadEntry)(void*);
|
||||
typedef int ThreadLocal;
|
||||
|
||||
static inline int MutexInit(Mutex* mutex) {
|
||||
Mutex id = sceKernelCreateMutex("mutex", 0, 0, 0);
|
||||
|
@ -145,6 +144,9 @@ static inline int ThreadSetName(const char* name) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
#if (__STDC_VERSION__ < 201112L) || (__STDC_NO_THREADS__ == 1)
|
||||
typedef int ThreadLocal;
|
||||
|
||||
static inline void ThreadLocalInitKey(ThreadLocal* key) {
|
||||
static int base = 0x90;
|
||||
*key = __atomic_fetch_add(&base, 1, __ATOMIC_SEQ_CST);
|
||||
|
@ -160,3 +162,4 @@ static inline void* ThreadLocalGetValue(ThreadLocal key) {
|
|||
return *tls;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -11,12 +11,6 @@
|
|||
CXX_GUARD_START
|
||||
|
||||
#ifndef DISABLE_THREADING
|
||||
#if (__STDC_VERSION__ >= 201112L) && (__STDC_NO_THREADS__ != 1)
|
||||
#define ThreadLocal _Thread_local void*
|
||||
#define ThreadLocalInitKey(X)
|
||||
#define ThreadLocalSetKey(K, V) K = V
|
||||
#define ThreadLocalGetValue(K) K
|
||||
#endif
|
||||
#ifdef USE_PTHREADS
|
||||
#include <mgba-util/platform/posix/threading.h>
|
||||
#elif defined(_WIN32)
|
||||
|
@ -31,7 +25,15 @@ CXX_GUARD_START
|
|||
#define DISABLE_THREADING
|
||||
#endif
|
||||
#endif
|
||||
#ifdef DISABLE_THREADING
|
||||
|
||||
#ifndef DISABLE_THREADING
|
||||
#if (__STDC_VERSION__ >= 201112L) && (__STDC_NO_THREADS__ != 1)
|
||||
#define ThreadLocal _Thread_local void*
|
||||
#define ThreadLocalInitKey(X)
|
||||
#define ThreadLocalSetKey(K, V) K = V
|
||||
#define ThreadLocalGetValue(K) K
|
||||
#endif
|
||||
#else
|
||||
#ifdef __3DS__
|
||||
// ctrulib already has a type called Thread
|
||||
#include <3ds/thread.h>
|
||||
|
|
Loading…
Reference in New Issue