mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
wasm: Better implementation of roc_panic in tests
This commit is contained in:
parent
2af4016f34
commit
5f64f32a4a
1 changed files with 7 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
// Makes test runs take 50% longer, due to linking
|
// Makes test runs take 50% longer, due to linking
|
||||||
#define ENABLE_PRINTF 0
|
#define ENABLE_PRINTF 0
|
||||||
|
@ -121,14 +122,13 @@ void roc_dealloc(void *ptr, unsigned int alignment)
|
||||||
|
|
||||||
//--------------------------
|
//--------------------------
|
||||||
|
|
||||||
void roc_panic(void *ptr, unsigned int alignment)
|
void roc_panic(char *msg, unsigned int tag_id)
|
||||||
{
|
{
|
||||||
#if ENABLE_PRINTF
|
// Note: no dynamic string formatting
|
||||||
char *msg = (char *)ptr;
|
fputs("Application crashed with message\n\n ", stderr);
|
||||||
fprintf(stderr,
|
fputs(msg, stderr);
|
||||||
"Application crashed with message\n\n %s\n\nShutting down\n", msg);
|
fputs("\n\nShutting down\n", stderr);
|
||||||
#endif
|
exit(101);
|
||||||
abort();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------
|
//--------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue