Skip to content

Commit f3695f3

Browse files
committed
[Imp] mpt/base/detect_quirks.hpp: Add MPT_LIBCXX_QUIRK_NO_STD_THREAD.
[Ref] mpt/base/detect_quirks.hpp: Rename MPT_COMPILER_QUIRK_COMPLEX_STD_MUTEX to MPT_LIBCXX_QUIRK_COMPLEX_STD_MUTEX. [Ref] mpt/mutex/mutex.hpp: Base logic on MPT_LIBCXX_QUIRK_NO_STD_THREAD. git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@23666 56274372-70c3-4bfc-bfc3-4c3a0b034d27
1 parent b6973ed commit f3695f3

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/mpt/base/detect_quirks.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,17 @@
115115

116116

117117

118+
#if !MPT_PLATFORM_MULTITHREADED
119+
#define MPT_LIBCXX_QUIRK_NO_STD_THREAD
120+
#elif !MPT_COMPILER_GENERIC && MPT_OS_WINDOWS && MPT_LIBCXX_GNU && !defined(_GLIBCXX_HAS_GTHREADS)
121+
#define MPT_LIBCXX_QUIRK_NO_STD_THREAD
122+
#endif
123+
124+
125+
118126
#if MPT_OS_WINDOWS && MPT_COMPILER_MSVC
119127
#if MPT_WINNT_AT_LEAST(MPT_WIN_VISTA)
120-
#define MPT_COMPILER_QUIRK_COMPLEX_STD_MUTEX
128+
#define MPT_LIBCXX_QUIRK_COMPLEX_STD_MUTEX
121129
#endif
122130
#endif
123131

src/mpt/mutex/mutex.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
#if !MPT_PLATFORM_MULTITHREADED
1313
#define MPT_MUTEX_NONE 1
14-
#elif MPT_COMPILER_GENERIC
15-
#define MPT_MUTEX_STD 1
16-
#elif MPT_OS_WINDOWS && MPT_LIBCXX_GNU && !defined(_GLIBCXX_HAS_GTHREADS)
14+
#elif defined(MPT_LIBCXX_QUIRK_NO_STD_THREAD)
1715
#define MPT_MUTEX_WIN32 1
1816
#else
1917
#define MPT_MUTEX_STD 1
@@ -31,7 +29,7 @@
3129

3230
#if MPT_MUTEX_STD
3331
#include <mutex>
34-
#ifdef MPT_COMPILER_QUIRK_COMPLEX_STD_MUTEX
32+
#ifdef MPT_LIBCXX_QUIRK_COMPLEX_STD_MUTEX
3533
#include <shared_mutex>
3634
#include <type_traits>
3735
#endif
@@ -48,7 +46,7 @@ inline namespace MPT_INLINE_NS {
4846

4947
#if MPT_MUTEX_STD
5048

51-
#ifdef MPT_COMPILER_QUIRK_COMPLEX_STD_MUTEX
49+
#ifdef MPT_LIBCXX_QUIRK_COMPLEX_STD_MUTEX
5250
using mutex = std::conditional<sizeof(std::shared_mutex) < sizeof(std::mutex), std::shared_mutex, std::mutex>::type;
5351
#else
5452
using mutex = std::mutex;

0 commit comments

Comments
 (0)