mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Make development more pleasant on MacOS Arm64
This commit is contained in:
parent
f7cad70da1
commit
0863427b3a
8 changed files with 90 additions and 10 deletions
|
@ -14,7 +14,8 @@
|
|||
#define _ASSERT_H
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void __assert_fail(const char *, const char *, int) wontreturn relegated;
|
||||
void __assert_fail(const char *, const char *, int);
|
||||
void __unassert_fail(const char *, const char *, int);
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define assert(x) ((void)0)
|
||||
|
@ -31,12 +32,14 @@ void __assert_fail(const char *, const char *, int) wontreturn relegated;
|
|||
#ifndef NDEBUG
|
||||
#define unassert(x) __assert_macro(x, #x)
|
||||
#define npassert(x) __assert_macro(x, #x)
|
||||
#define __assert_macro(x, s) \
|
||||
({ \
|
||||
if (__builtin_expect(!(x), 0)) { \
|
||||
__assert_fail(s, __FILE__, __LINE__); \
|
||||
} \
|
||||
(void)0; \
|
||||
#define __assert_macro(x, s) \
|
||||
({ \
|
||||
if (__builtin_expect(!(x), 0)) { \
|
||||
__unassert_fail(s, __FILE__, __LINE__); \
|
||||
__asm__("nop"); \
|
||||
__builtin_unreachable(); \
|
||||
} \
|
||||
(void)0; \
|
||||
})
|
||||
#else
|
||||
#define npassert(x) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue