mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Remove bad defines from early days of project
These definitions were causing issues with building LLVM. It is possible they also caused crashes we've seen with our MacOS ARM64 OpenMP support.
This commit is contained in:
parent
f25fbbaaeb
commit
5dd7ddb9ea
20 changed files with 568 additions and 140 deletions
|
@ -48,6 +48,12 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {0, {}, PTHREAD_MUTEX_RECURSIVE}
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define _PTHREAD_ATOMIC(x) _Atomic(x)
|
||||
#else
|
||||
#define _PTHREAD_ATOMIC(x) x
|
||||
#endif
|
||||
|
||||
typedef uintptr_t pthread_t;
|
||||
typedef int pthread_id_np_t;
|
||||
typedef char pthread_condattr_t;
|
||||
|
@ -57,20 +63,20 @@ typedef unsigned pthread_key_t;
|
|||
typedef void (*pthread_key_dtor)(void *);
|
||||
|
||||
typedef struct pthread_once_s {
|
||||
_Atomic(uint32_t) _lock;
|
||||
_PTHREAD_ATOMIC(uint32_t) _lock;
|
||||
} pthread_once_t;
|
||||
|
||||
typedef struct pthread_spinlock_s {
|
||||
_Atomic(int) _lock;
|
||||
_PTHREAD_ATOMIC(int) _lock;
|
||||
} pthread_spinlock_t;
|
||||
|
||||
typedef struct pthread_mutex_s {
|
||||
uint32_t _nsync;
|
||||
union {
|
||||
int32_t _pid;
|
||||
_Atomic(int32_t) _futex;
|
||||
_PTHREAD_ATOMIC(int32_t) _futex;
|
||||
};
|
||||
_Atomic(uint64_t) _word;
|
||||
_PTHREAD_ATOMIC(uint64_t) _word;
|
||||
} pthread_mutex_t;
|
||||
|
||||
typedef struct pthread_mutexattr_s {
|
||||
|
@ -85,8 +91,8 @@ typedef struct pthread_cond_s {
|
|||
char _pshared;
|
||||
};
|
||||
};
|
||||
_Atomic(uint32_t) _sequence;
|
||||
_Atomic(uint32_t) _waiters;
|
||||
_PTHREAD_ATOMIC(uint32_t) _sequence;
|
||||
_PTHREAD_ATOMIC(uint32_t) _waiters;
|
||||
} pthread_cond_t;
|
||||
|
||||
typedef struct pthread_rwlock_s {
|
||||
|
@ -97,8 +103,8 @@ typedef struct pthread_rwlock_s {
|
|||
typedef struct pthread_barrier_s {
|
||||
int _count;
|
||||
char _pshared;
|
||||
_Atomic(int) _counter;
|
||||
_Atomic(int) _waiters;
|
||||
_PTHREAD_ATOMIC(int) _counter;
|
||||
_PTHREAD_ATOMIC(int) _waiters;
|
||||
} pthread_barrier_t;
|
||||
|
||||
typedef struct pthread_attr_s {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue