Skip to content

Commit 1431f8f

Browse files
authored
[libc++] Simplify definition of __libcpp_recursive_mutex_t (#147385)
As it only depends of pointer size, use `_WIN64` define to simplify conditions.
1 parent 3e4e5db commit 1431f8f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

libcxx/include/__cxx03/__thread/support/windows.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ using __libcpp_timespec_t = ::timespec;
2828
typedef void* __libcpp_mutex_t;
2929
#define _LIBCPP_MUTEX_INITIALIZER 0
3030

31-
#if defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__arm__)
32-
typedef void* __libcpp_recursive_mutex_t[6];
33-
#elif defined(_M_AMD64) || defined(__x86_64__) || defined(_M_ARM64) || defined(__aarch64__)
31+
#if defined(_WIN64)
3432
typedef void* __libcpp_recursive_mutex_t[5];
3533
#else
36-
# error Unsupported architecture
34+
typedef void* __libcpp_recursive_mutex_t[6];
3735
#endif
3836

3937
_LIBCPP_EXPORTED_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t* __m);

libcxx/include/__thread/support/windows.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ using __libcpp_timespec_t = ::timespec;
2828
typedef void* __libcpp_mutex_t;
2929
#define _LIBCPP_MUTEX_INITIALIZER 0
3030

31-
#if defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__arm__)
32-
typedef void* __libcpp_recursive_mutex_t[6];
33-
#elif defined(_M_AMD64) || defined(__x86_64__) || defined(_M_ARM64) || defined(__aarch64__)
31+
#if defined(_WIN64)
3432
typedef void* __libcpp_recursive_mutex_t[5];
3533
#else
36-
# error Unsupported architecture
34+
typedef void* __libcpp_recursive_mutex_t[6];
3735
#endif
3836

3937
_LIBCPP_EXPORTED_FROM_ABI int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t* __m);

0 commit comments

Comments
 (0)