summaryrefslogtreecommitdiff
path: root/src/template
diff options
context:
space:
mode:
Diffstat (limited to 'src/template')
-rw-r--r--src/template/wasm2c.declarations.c2
-rw-r--r--src/template/wasm2c.includes.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/template/wasm2c.declarations.c b/src/template/wasm2c.declarations.c
index 3861c52d..f036ba19 100644
--- a/src/template/wasm2c.declarations.c
+++ b/src/template/wasm2c.declarations.c
@@ -122,7 +122,7 @@ DEFINE_STORE(i64_store32, u32, u64)
#if defined(_MSC_VER)
-#include <intrin.h>
+#define alloca _alloca
// Adapted from
// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h
diff --git a/src/template/wasm2c.includes.c b/src/template/wasm2c.includes.c
index 91e7c21d..8b61e643 100644
--- a/src/template/wasm2c.includes.c
+++ b/src/template/wasm2c.includes.c
@@ -1,2 +1,8 @@
#include <math.h>
#include <string.h>
+#if defined(_MSC_VER)
+#include <intrin.h>
+#include <malloc.h>
+#else
+#include <alloca.h>
+#endif