Skip to content

Commit 1ac8557

Browse files
committed
add WASI_HOST_FUNC2
APIs defined with wit often have "-" in the names, for which the existing WASI_HOST_FUNC macro is not usable.
1 parent a5ca764 commit 1ac8557

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/wasi_impl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
.func = wasi_##NAME, \
55
}
66

7+
#define WASI_HOST_FUNC2(NAME, FUNC, TYPE) \
8+
{ \
9+
.name = NAME_FROM_CSTR_LITERAL(NAME), .type = TYPE, \
10+
.func = FUNC, \
11+
}
12+
713
#if defined(TOYWASM_ENABLE_TRACING)
814
#define WASI_TRACE \
915
do { \

0 commit comments

Comments
 (0)