Implement native function pointer check, addr conversion and register, update documents (#185)
Modified WASM runtime API: - wasm_runtime_module_malloc() - wasm_runtime_lookup_function() Introduced runtime API - wasm_runtime_register_natives()
This commit is contained in:
@ -13,10 +13,16 @@ extern "C" {
|
||||
typedef struct NativeSymbol {
|
||||
const char *symbol;
|
||||
void *func_ptr;
|
||||
const char *signature;
|
||||
} NativeSymbol;
|
||||
|
||||
#define EXPORT_WASM_API(symbol) {#symbol, (void*)symbol}
|
||||
#define EXPORT_WASM_API2(symbol) {#symbol, (void*)symbol##_wrapper}
|
||||
#define EXPORT_WASM_API(symbol) {#symbol, (void*)symbol, NULL}
|
||||
#define EXPORT_WASM_API2(symbol) {#symbol, (void*)symbol##_wrapper, NULL}
|
||||
|
||||
#define EXPORT_WASM_API_WITH_SIG(symbol, signature) \
|
||||
{#symbol, (void*)symbol, signature}
|
||||
#define EXPORT_WASM_API_WITH_SIG2(symbol, signature) \
|
||||
{#symbol, (void*)symbol##_wrapper, signature}
|
||||
|
||||
/**
|
||||
* Get the exported APIs of base lib
|
||||
|
||||
Reference in New Issue
Block a user