aboutsummaryrefslogtreecommitdiff
path: root/src/chips/common
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2022-12-23 09:53:40 +0300
committerWohlstand <admin@wohlnet.ru>2022-12-23 09:53:40 +0300
commit54f4a68c7065a1ba1b4daf9644a7c11215ef5e94 (patch)
treee670ead3bb221e31760f32d3c284b2ee70577801 /src/chips/common
parentb1340ac658133034cb70f68ab4f1c9a0923bd76b (diff)
downloadlibADLMIDI-54f4a68c7065a1ba1b4daf9644a7c11215ef5e94.tar.gz
libADLMIDI-54f4a68c7065a1ba1b4daf9644a7c11215ef5e94.tar.bz2
libADLMIDI-54f4a68c7065a1ba1b4daf9644a7c11215ef5e94.zip
Misc: Added WUT mutex support
Diffstat (limited to 'src/chips/common')
-rw-r--r--src/chips/common/mutex.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/chips/common/mutex.hpp b/src/chips/common/mutex.hpp
index 02ad1c7..a8d23b2 100644
--- a/src/chips/common/mutex.hpp
+++ b/src/chips/common/mutex.hpp
@@ -25,6 +25,12 @@
# if defined(USE_LIBOGC_MUTEX)
# include <ogc/mutex.h>
typedef mutex_t MutexNativeObject;
+# elif defined(USE_WUT_MUTEX)
+# if __cplusplus < 201103L || (defined(_MSC_VER) && _MSC_VER < 1900)
+# define static_assert(x, y)
+# endif
+# include <coreinit/mutex.h>
+typedef OSMutex MutexNativeObject;
# elif !defined(_WIN32)
# include <pthread.h>
typedef pthread_mutex_t MutexNativeObject;
@@ -75,6 +81,26 @@ inline void Mutex::lock()
inline void Mutex::unlock()
{}
+#elif defined(USE_WUT_MUTEX)
+
+inline Mutex::Mutex()
+{
+ OSInitMutex(&m);
+}
+
+inline Mutex::~Mutex()
+{}
+
+inline void Mutex::lock()
+{
+ OSLockMutex(&m);
+}
+
+inline void Mutex::unlock()
+{
+ OSUnlockMutex(&m);
+}
+
#elif defined(USE_LIBOGC_MUTEX)
inline Mutex::Mutex()