diff --git a/src/gba/gba-thread.c b/src/gba/gba-thread.c index 57f296afe..77b175b6d 100644 --- a/src/gba/gba-thread.c +++ b/src/gba/gba-thread.c @@ -84,6 +84,7 @@ static void _pauseThread(struct GBAThread* threadContext, bool onThread) { _waitUntilNotState(threadContext, THREAD_PAUSING); } } +#endif static void _changeVideoSync(struct GBASync* sync, bool frameOn) { // Make sure the video thread can process events while the GBA thread is paused @@ -95,6 +96,7 @@ static void _changeVideoSync(struct GBASync* sync, bool frameOn) { MutexUnlock(&sync->videoFrameMutex); } +#ifndef DISABLE_THREADING static THREAD_ENTRY _GBAThreadRun(void* context) { #ifdef USE_PTHREADS pthread_once(&_contextOnce, _createTLS); @@ -534,7 +536,7 @@ struct GBAThread* GBAThreadGetContext(void) { pthread_once(&_contextOnce, _createTLS); return pthread_getspecific(_contextKey); } -#else +#elif _WIN32 struct GBAThread* GBAThreadGetContext(void) { InitOnceExecuteOnce(&_contextOnce, _createTLS, NULL, 0); return TlsGetValue(_contextKey); @@ -555,6 +557,12 @@ void GBAThreadTakeScreenshot(struct GBAThread* threadContext) { } #endif +#else +struct GBAThread* GBAThreadGetContext(void) { + return 0; +} +#endif + void GBASyncPostFrame(struct GBASync* sync) { if (!sync) { return; @@ -651,4 +659,3 @@ void GBASyncConsumeAudio(struct GBASync* sync) { ConditionWake(&sync->audioRequiredCond); MutexUnlock(&sync->audioBufferMutex); } -#endif diff --git a/src/util/threading.h b/src/util/threading.h index 65c1b7ff4..6dc09fb50 100644 --- a/src/util/threading.h +++ b/src/util/threading.h @@ -126,6 +126,47 @@ static inline int ThreadJoin(Thread thread) { typedef void* Thread; typedef void* Mutex; typedef void* Condition; + +static inline int MutexInit(Mutex* mutex) { + UNUSED(mutex); + return 0; +} + +static inline int MutexDeinit(Mutex* mutex) { + UNUSED(mutex); + return 0; +} + +static inline int MutexLock(Mutex* mutex) { + UNUSED(mutex); + return 0; +} + +static inline int MutexUnlock(Mutex* mutex) { + UNUSED(mutex); + return 0; +} + +static inline int ConditionInit(Condition* cond) { + UNUSED(cond); + return 0; +} + +static inline int ConditionDeinit(Condition* cond) { + UNUSED(cond); + return 0; +} + +static inline int ConditionWait(Condition* cond, Mutex* mutex) { + UNUSED(cond); + UNUSED(mutex); + return 0; +} + +static inline int ConditionWake(Condition* cond) { + UNUSED(cond); + return 0; +} #endif #endif