Skip to content

Commit

Permalink
Merge pull request #8 from zed-industries/wasm-support
Browse files Browse the repository at this point in the history
Avoid using unavailable functions when compiling to wasm
  • Loading branch information
6cdh authored Apr 12, 2024
2 parents d9858a0 + beb29de commit 0473f94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ typedef struct {

static void check_alloc(void *ptr) {
if (ptr == NULL) {
fprintf(stderr, "Scanner: Failed to allocate memory\n");
exit(EXIT_FAILURE);
#ifndef __wasm32__
fprintf(stderr, "Scanner: Failed to allocate memory\n");
#endif
abort();
}
}

Expand Down

0 comments on commit 0473f94

Please sign in to comment.