mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 04:08:32 +00:00
Fix ucontext_t alignment in strict ansi mode
Using `cosmocc -std=c11` was causing `ucontext_t` to become misaligned. This change also adds the GNU constants on x86_64 for accessing general registers, so you will not need `#ifdef`s to support both Cosmo and GNU
This commit is contained in:
parent
b8d1377ae1
commit
15af5c2d7e
2 changed files with 28 additions and 12 deletions
|
@ -174,18 +174,9 @@ typedef struct {
|
|||
#endif
|
||||
|
||||
#ifndef forcealign
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define forcealign(bytes) __attribute__((__aligned__(bytes)))
|
||||
#else
|
||||
#define forcealign(bytes)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define thatispacked __attribute__((__packed__))
|
||||
#else
|
||||
#define thatispacked
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define printfesque(n) __attribute__((__format__(__gnu_printf__, n, n + 1)))
|
||||
|
@ -727,8 +718,7 @@ void abort(void) wontreturn;
|
|||
#define __static_yoink_source(PATH)
|
||||
#endif
|
||||
|
||||
#define __weak_reference(sym, alias) \
|
||||
__weak_reference_impl(sym, alias)
|
||||
#define __weak_reference(sym, alias) __weak_reference_impl(sym, alias)
|
||||
#define __weak_reference_impl(sym, alias) \
|
||||
__asm__(".weak\t" #alias "\n\t" \
|
||||
".equ\t" #alias ", " #sym "\n\t" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue