mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Always use compiler builtin for offsetof()
We have received multiple reports of GCC breaking builds when compiler flags like `-std=c11` were being passed. The workaround until the next release is to simply not define `__STRICT_ANSI__` which is a bad idea.
This commit is contained in:
parent
e36283f1d9
commit
06ace4e7b4
2 changed files with 1 additions and 6 deletions
|
@ -473,12 +473,7 @@ typedef struct {
|
||||||
#define autotype(x) typeof(x)
|
#define autotype(x) typeof(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__STRICT_ANSI__) || \
|
|
||||||
(!defined(__GNUC__) && !defined(__builtin_offsetof))
|
|
||||||
#define offsetof(type, member) ((unsigned long)&((type *)0)->member)
|
|
||||||
#else
|
|
||||||
#define offsetof(type, member) __builtin_offsetof(type, member)
|
#define offsetof(type, member) __builtin_offsetof(type, member)
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _COSMO_SOURCE
|
#ifdef _COSMO_SOURCE
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ static void _pthread_cancel_sig(int sig, siginfo_t *si, void *arg) {
|
||||||
if (pt->pt_flags & PT_NOCANCEL) return;
|
if (pt->pt_flags & PT_NOCANCEL) return;
|
||||||
if (!atomic_load_explicit(&pt->pt_canceled, memory_order_acquire)) return;
|
if (!atomic_load_explicit(&pt->pt_canceled, memory_order_acquire)) return;
|
||||||
|
|
||||||
// in asynchronous mode we'll just the exit asynchronously
|
// in asynchronous mode the asynchronous signal calls exit
|
||||||
if (pt->pt_flags & PT_ASYNC) {
|
if (pt->pt_flags & PT_ASYNC) {
|
||||||
sigaddset(&ctx->uc_sigmask, SIGTHR);
|
sigaddset(&ctx->uc_sigmask, SIGTHR);
|
||||||
pthread_sigmask(SIG_SETMASK, &ctx->uc_sigmask, 0);
|
pthread_sigmask(SIG_SETMASK, &ctx->uc_sigmask, 0);
|
||||||
|
|
Loading…
Reference in a new issue