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:
Justine Tunney 2024-07-24 12:11:21 -07:00
parent f25fbbaaeb
commit 5dd7ddb9ea
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
20 changed files with 568 additions and 140 deletions

View file

@ -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 {