mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 01:54:43 +03:00
u3: specially defines c3_assert for ASan compatiblity
This commit is contained in:
parent
884a08a967
commit
bea30f8a2c
@ -17,16 +17,27 @@
|
||||
**/
|
||||
/* Assert. Good to capture.
|
||||
*/
|
||||
# define c3_assert(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
fprintf(stderr, "\rAssertion '%s' " \
|
||||
"failed in %s:%d\n", \
|
||||
#x, __FILE__, __LINE__); \
|
||||
c3_cooked(); \
|
||||
assert(x); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
# if defined(ASAN_ENABLED) && defined(__clang__)
|
||||
# define c3_assert(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
c3_cooked(); \
|
||||
assert(x); \
|
||||
} \
|
||||
} while(0)
|
||||
# else
|
||||
# define c3_assert(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
fprintf(stderr, "\rAssertion '%s' " \
|
||||
"failed in %s:%d\n", \
|
||||
#x, __FILE__, __LINE__); \
|
||||
c3_cooked(); \
|
||||
assert(x); \
|
||||
} \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
/* Stub.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user