|
|
@ -1,11 +1,21 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WEB
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static inline void assert_impl(bool cond, const char *expression)
|
|
|
|
static inline void assert_impl(bool cond, const char *expression)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!cond)
|
|
|
|
if(!cond)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Assertion failed: %s\n", expression);
|
|
|
|
fprintf(stderr, "Assertion failed: %s\n", expression);
|
|
|
|
|
|
|
|
#ifdef WEB
|
|
|
|
|
|
|
|
assert(false);
|
|
|
|
|
|
|
|
#elif defined(DESKTOP)
|
|
|
|
__debugbreak();
|
|
|
|
__debugbreak();
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#error "Don't know how to assert for current platform configuration"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef assert
|
|
|
|
#ifdef assert
|
|
|
|