Skip to content

Commit 6f95b97

Browse files
committed
Bring in changes for GEKKO from upstream
1 parent 7dce21c commit 6f95b97

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

deps/rcheevos/src/rc_compat.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,24 @@ void rc_mutex_unlock(rc_mutex_t* mutex)
120120

121121
void rc_mutex_init(rc_mutex_t* mutex)
122122
{
123-
LWP_MutexInit(mutex, NULL);
123+
/* LWP_MutexInit has the handle passed by reference */
124+
/* Other LWP_Mutex* calls have the handle passed by value */
125+
LWP_MutexInit(&mutex->handle, 1);
124126
}
125127

126128
void rc_mutex_destroy(rc_mutex_t* mutex)
127129
{
128-
LWP_MutexDestroy(mutex);
130+
LWP_MutexDestroy(mutex->handle);
129131
}
130132

131133
void rc_mutex_lock(rc_mutex_t* mutex)
132134
{
133-
LWP_MutexLock(mutex);
135+
LWP_MutexLock(mutex->handle);
134136
}
135137

136138
void rc_mutex_unlock(rc_mutex_t* mutex)
137139
{
138-
LWP_MutexUnlock(mutex);
140+
LWP_MutexUnlock(mutex->handle);
139141
}
140142

141143
#elif defined(_3DS)

deps/rcheevos/src/rc_compat.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ RC_BEGIN_C_DECLS
8181
typedef struct rc_mutex_t {
8282
void* handle; /* HANDLE is defined as "void*" */
8383
} rc_mutex_t;
84+
#elif defined(GEKKO)
85+
#include <ogcsys.h>
86+
typedef struct rc_mutex_t {
87+
mutex_t handle;
88+
} rc_mutex_t;
8489
#elif defined(_3DS)
8590
#include <3ds/synchronization.h>
8691
typedef RecursiveLock rc_mutex_t;

0 commit comments

Comments
 (0)