2018-10-28 08:36:21 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-31 01:09:11 +00:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
2018-10-28 08:36:21 +00:00
|
|
|
|
2019-01-13 23:35:07 +00:00
|
|
|
void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func) __attribute__ ((noreturn));
|
2018-10-28 08:36:21 +00:00
|
|
|
|
2018-10-31 16:50:43 +00:00
|
|
|
#define assert(expr) ((expr) ? (void)0 : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
|
2018-10-28 08:36:21 +00:00
|
|
|
#define CRASH() do { asm volatile("ud2"); } while(0)
|
|
|
|
#define ASSERT assert
|
|
|
|
#define RELEASE_ASSERT assert
|
|
|
|
#define ASSERT_NOT_REACHED() assert(false)
|
|
|
|
|
2018-10-31 01:09:11 +00:00
|
|
|
__END_DECLS
|
2018-10-28 08:36:21 +00:00
|
|
|
|