aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
-rw-r--r--src/chips/common/mutex.hpp26
2 files changed, 34 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 989741a..1eee60d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,21 +26,26 @@ if(DJGPP OR MSDOS)
add_definitions(-DADLMIDI_HW_OPL)
endif()
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
+if(Nintendo3DS)
set(ADLMIDI_3DS 1)
add_definitions(-DDOSBOX_NO_MUTEX)
endif()
-if(${CMAKE_SYSTEM_NAME} STREQUAL "NintendoDS")
+if(NINTENDO_DS)
set(ADLMIDI_DS 1)
add_definitions(-DDOSBOX_NO_MUTEX)
endif()
-if(${CMAKE_SYSTEM_NAME} STREQUAL "NintendoWii")
+if(NINTENDO_WII)
set(ADLMIDI_WII 1)
add_definitions(-DUSE_LIBOGC_MUTEX)
endif()
+if(NINTENDO_WIIU)
+ set(ADLMIDI_WIIU 1)
+ add_definitions(-DUSE_WUT_MUTEX)
+endif()
+
#===========================================================================================
# Strip garbage
if(APPLE)
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()