summaryrefslogtreecommitdiff
path: root/wasm2c/examples/fac/fac.c
diff options
context:
space:
mode:
Diffstat (limited to 'wasm2c/examples/fac/fac.c')
-rw-r--r--wasm2c/examples/fac/fac.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/wasm2c/examples/fac/fac.c b/wasm2c/examples/fac/fac.c
index 106d7768..05b93cd8 100644
--- a/wasm2c/examples/fac/fac.c
+++ b/wasm2c/examples/fac/fac.c
@@ -1,6 +1,12 @@
/* Automatically generated by wasm2c */
#include <math.h>
#include <string.h>
+#if defined(_MSC_VER)
+#include <intrin.h>
+#include <malloc.h>
+#else
+#include <alloca.h>
+#endif
#include "fac.h"
@@ -127,7 +133,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
@@ -453,6 +459,8 @@ static u32 func_types[1];
static void init_func_types(void) {
func_types[0] = wasm_rt_register_func_type(1, 1, WASM_RT_I32, WASM_RT_I32);
}
+static void init_tags(void) {
+}
static u32 w2c_fac(u32);
@@ -496,6 +504,7 @@ static void init_exports(void) {
void Z_fac_init(void) {
init_func_types();
+ init_tags();
init_globals();
init_memory();
init_table();