File tree Expand file tree Collapse file tree 7 files changed +302
-256
lines changed Expand file tree Collapse file tree 7 files changed +302
-256
lines changed Original file line number Diff line number Diff line change 12
12
#include "llvm-libc-types/__futex_word.h"
13
13
#include "llvm-libc-types/pid_t.h"
14
14
typedef struct {
15
- bool __is_pshared ;
16
- char __preference ;
15
+ unsigned __is_pshared : 1 ;
16
+ unsigned __preference : 1 ;
17
17
int __state ;
18
18
pid_t __writier_tid ;
19
19
__futex_word __wait_queue_mutex ;
20
- __futex_word __pending_reader ;
21
- __futex_word __pending_writer ;
20
+ __futex_word __pending_readers ;
21
+ __futex_word __pending_writers ;
22
22
__futex_word __reader_serialization ;
23
23
__futex_word __writer_serialization ;
24
24
} pthread_rwlock_t ;
Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ def POSIX : StandardSpec<"POSIX"> {
113
113
NamedType PThreadRWLockAttrTType = NamedType<"pthread_rwlockattr_t">;
114
114
PtrType PThreadRWLockAttrTPtr = PtrType<PThreadRWLockAttrTType>;
115
115
ConstType ConstPThreadRWLockAttrTPtr = ConstType<PThreadRWLockAttrTPtr>;
116
- ConstType ConstRestrictedPThreadRWLockAttrTPtr = ConstType<RestrictedPtrType<PThreadRWLockAttrTType>>;
116
+ RestrictedPtrType RestrictedPThreadRWLockAttrTPtr = RestrictedPtrType<PThreadRWLockAttrTType>;
117
+ ConstType ConstRestrictedPThreadRWLockAttrTPtr = ConstType<RestrictedPThreadRWLockAttrTPtr>;
117
118
118
119
NamedType PThreadMutexAttrTType = NamedType<"pthread_mutexattr_t">;
119
120
PtrType PThreadMutexAttrTPtr = PtrType<PThreadMutexAttrTType>;
@@ -1283,12 +1284,12 @@ def POSIX : StandardSpec<"POSIX"> {
1283
1284
FunctionSpec<
1284
1285
"pthread_rwlock_timedrdlock",
1285
1286
RetValSpec<IntType>,
1286
- [ArgSpec<RestrictedPThreadRWLockTPtr>, ArgSpec<ConstRestructTimeSpecPtr >]
1287
+ [ArgSpec<RestrictedPThreadRWLockTPtr>, ArgSpec<ConstRestrictStructTimeSpecPtr >]
1287
1288
>,
1288
1289
FunctionSpec<
1289
1290
"pthread_rwlock_timedwrlock",
1290
1291
RetValSpec<IntType>,
1291
- [ArgSpec<RestrictedPThreadRWLockTPtr>, ArgSpec<ConstRestructTimeSpecPtr >]
1292
+ [ArgSpec<RestrictedPThreadRWLockTPtr>, ArgSpec<ConstRestrictStructTimeSpecPtr >]
1292
1293
>,
1293
1294
FunctionSpec<
1294
1295
"pthread_rwlock_rdlock",
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ def TimeTType : NamedType<"time_t">;
126
126
def StructTimeSpec : NamedType<"struct timespec">;
127
127
def StructTimeSpecPtr : PtrType<StructTimeSpec>;
128
128
def ConstStructTimeSpecPtr : ConstType<StructTimeSpecPtr>;
129
- def ConstRestructTimeSpecPtr : ConstType<RestrictedPtrType<StructTimeSpec>>;
129
+ def RestrictStructTimeSpecPtr : RestrictedPtrType<StructTimeSpec>;
130
+ def ConstRestrictStructTimeSpecPtr : ConstType<RestrictStructTimeSpecPtr>;
130
131
131
132
def BSearchCompareT : NamedType<"__bsearchcompare_t">;
132
133
def QSortCompareT : NamedType<"__qsortcompare_t">;
Original file line number Diff line number Diff line change 42
42
#define LIBC_CONSTINIT
43
43
#endif
44
44
45
+ #ifdef __clang__
46
+ #define LIBC_PREFERED_TYPE (TYPE ) [[clang::preferred_type(TYPE)]]
47
+ #else
48
+ #define LIBC_PREFERED_TYPE (TYPE )
49
+ #endif
50
+
45
51
#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_ATTRIBUTES_H
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ add_header_library(
54
54
.raw_mutex
55
55
libc.src.__support.common
56
56
libc.src.__support.OSUtil.osutil
57
+ libc.src.__support.CPP.limits
57
58
COMPILE_OPTIONS
58
59
-DLIBC_COPT_RWLOCK_DEFAULT_SPIN_COUNT=${LIBC_CONF_RWLOCK_DEFAULT_SPIN_COUNT}
59
60
${monotonicity_flags}
You can’t perform that action at this time.
0 commit comments