diff --git a/deps/rcheevos/src/rc_compat.c b/deps/rcheevos/src/rc_compat.c index e3e6371605..80044d37de 100644 --- a/deps/rcheevos/src/rc_compat.c +++ b/deps/rcheevos/src/rc_compat.c @@ -120,22 +120,24 @@ void rc_mutex_unlock(rc_mutex_t* mutex) void rc_mutex_init(rc_mutex_t* mutex) { - LWP_MutexInit(mutex, NULL); + /* LWP_MutexInit has the handle passed by reference */ + /* Other LWP_Mutex* calls have the handle passed by value */ + LWP_MutexInit(&mutex->handle, 1); } void rc_mutex_destroy(rc_mutex_t* mutex) { - LWP_MutexDestroy(mutex); + LWP_MutexDestroy(mutex->handle); } void rc_mutex_lock(rc_mutex_t* mutex) { - LWP_MutexLock(mutex); + LWP_MutexLock(mutex->handle); } void rc_mutex_unlock(rc_mutex_t* mutex) { - LWP_MutexUnlock(mutex); + LWP_MutexUnlock(mutex->handle); } #elif defined(_3DS) diff --git a/deps/rcheevos/src/rc_compat.h b/deps/rcheevos/src/rc_compat.h index 9d44f2828e..614d1bc273 100644 --- a/deps/rcheevos/src/rc_compat.h +++ b/deps/rcheevos/src/rc_compat.h @@ -81,6 +81,11 @@ RC_BEGIN_C_DECLS typedef struct rc_mutex_t { void* handle; /* HANDLE is defined as "void*" */ } rc_mutex_t; + #elif defined(GEKKO) + #include + typedef struct rc_mutex_t { + mutex_t handle; + } rc_mutex_t; #elif defined(_3DS) #include <3ds/synchronization.h> typedef RecursiveLock rc_mutex_t;