diff options
Diffstat (limited to 'wasm2c/examples/fac')
-rw-r--r-- | wasm2c/examples/fac/Makefile | 2 | ||||
-rw-r--r-- | wasm2c/examples/fac/fac.c | 6 | ||||
-rw-r--r-- | wasm2c/examples/fac/fac.h | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/wasm2c/examples/fac/Makefile b/wasm2c/examples/fac/Makefile index a5179a71..623fcfc3 100644 --- a/wasm2c/examples/fac/Makefile +++ b/wasm2c/examples/fac/Makefile @@ -12,6 +12,6 @@ fac.wasm: fac.wat ../../../bin/wat2wasm ../../../bin/wat2wasm $< -o $@ fac.c: fac.wasm ../../../bin/wasm2c - ../../../bin/wasm2c $< -o $@ + ../../../bin/wasm2c $< -o $@ --disable-simd .PHONY: all clean diff --git a/wasm2c/examples/fac/fac.c b/wasm2c/examples/fac/fac.c index 970abbe1..683c5d80 100644 --- a/wasm2c/examples/fac/fac.c +++ b/wasm2c/examples/fac/fac.c @@ -4,10 +4,14 @@ #include <stdarg.h> #include <stddef.h> #include <string.h> -#if defined(_MSC_VER) +#if defined(__MINGW32__) +#include <malloc.h> +#elif defined(_MSC_VER) #include <intrin.h> #include <malloc.h> #define alloca _alloca +#elif defined(__FreeBSD__) || defined(__OpenBSD__) +#include <stdlib.h> #else #include <alloca.h> #endif diff --git a/wasm2c/examples/fac/fac.h b/wasm2c/examples/fac/fac.h index 5450fe42..f85dc5a9 100644 --- a/wasm2c/examples/fac/fac.h +++ b/wasm2c/examples/fac/fac.h @@ -6,6 +6,10 @@ #include "wasm-rt.h" +#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) +#include "wasm-rt-exceptions.h" +#endif + #if defined(WASM_RT_ENABLE_SIMD) #include "simde/wasm/simd128.h" #endif |