2018-10-28 11:36:21 +03:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-31 04:09:11 +03:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
2018-10-28 11:36:21 +03:00
|
|
|
|
2019-02-16 00:37:20 +03:00
|
|
|
__attribute__((noreturn)) void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func);
|
2018-10-28 11:36:21 +03:00
|
|
|
|
2018-10-31 19:50:43 +03:00
|
|
|
#define assert(expr) ((expr) ? (void)0 : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
|
2018-10-28 11:36:21 +03: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 04:09:11 +03:00
|
|
|
__END_DECLS
|
2018-10-28 11:36:21 +03:00
|
|
|
|