Make custom assert work in wasm

main
Cameron Murphy Reikes 2 years ago
parent 50a9252df3
commit 51a31cc7ea

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

@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdbool.h>
#define DESKTOP
#include "better_assert.h"
#include "buff.h"

@ -2,12 +2,18 @@
// you will die someday
#define SOKOL_IMPL
#if defined(WIN32) || defined(_WIN32)
#define DESKTOP
#define WINDOWS
#define SOKOL_D3D11
#endif
#if defined(__EMSCRIPTEN__)
#define WEB
#define SOKOL_GLES2
#endif
#ifdef WINDOWS
#include <Windows.h>
#include <processthreadsapi.h>
@ -15,6 +21,7 @@
#endif
#include "buff.h"
#include "sokol_app.h"
#include "sokol_gfx.h"

Loading…
Cancel
Save