summaryrefslogtreecommitdiffhomepage
path: root/src/wasm/nxt_wasm.h
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-10-10 20:54:39 +0100
committerAndrew Clayton <a.clayton@nginx.com>2023-10-10 20:54:39 +0100
commit8f6449f4e0152d9644b807cf2208e3734a0f8b4d (patch)
tree266081fadb3ca5131e22452e315f6a6dd544d32e /src/wasm/nxt_wasm.h
parent01d185cb52af8879aeeab04765eff439feec664c (diff)
downloadunit-8f6449f4e0152d9644b807cf2208e3734a0f8b4d.tar.gz
unit-8f6449f4e0152d9644b807cf2208e3734a0f8b4d.tar.bz2
[WIP] Wasm: Add a WAMR based language modulewasm
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/wasm/nxt_wasm.h')
-rw-r--r--src/wasm/nxt_wasm.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm/nxt_wasm.h b/src/wasm/nxt_wasm.h
index 6bc3ae35..90e91b2b 100644
--- a/src/wasm/nxt_wasm.h
+++ b/src/wasm/nxt_wasm.h
@@ -11,9 +11,11 @@
#include <nxt_unit.h>
-#include <wasm.h>
#if defined(NXT_HAVE_WASM_WASMTIME)
+#include <wasm.h>
#include <wasmtime.h>
+#elif defined(NXT_HAVE_WASM_WAMR)
+#include <wasm_export.h>
#endif
@@ -21,7 +23,9 @@
#define NXT_WASM_MEM_SIZE (32UL * 1024 * 1024)
#if defined(NXT_HAVE_WASM_WASMTIME)
-typedef wasmtime_func_t nxt_wasm_func_t;
+typedef wasmtime_func_t nxt_wasm_func_t;
+#elif defined(NXT_HAVE_WASM_WAMR)
+typedef wasm_function_inst_t nxt_wasm_func_t;
#endif
@@ -113,6 +117,7 @@ struct nxt_wasm_ctx_s {
nxt_wasm_func_handler_t fh[NXT_WASM_FH_NR];
char **dirs;
+ size_t nr_dirs;
nxt_unit_request_info_t *req;