Enable multi-module support for wasm-c-api (#426)
it is allowed that all imported functions and globals can be linked by multi-module feature automatically or by wasm-c-api manually
This commit is contained in:
@ -4,6 +4,14 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "wasm_c_api.h"
|
||||
#include "wasm_export.h"
|
||||
#include "bh_platform.h"
|
||||
|
||||
extern bool
|
||||
reader(const char *module_name, uint8 **p_buffer, uint32 *p_size);
|
||||
|
||||
extern void
|
||||
destroyer(uint8 *buffer, uint32 size);
|
||||
|
||||
#define own
|
||||
|
||||
@ -61,6 +69,8 @@ own wasm_trap_t* closure_callback(
|
||||
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
wasm_runtime_set_module_reader(reader, destroyer);
|
||||
|
||||
// Initialize.
|
||||
printf("Initializing...\n");
|
||||
wasm_engine_t* engine = wasm_engine_new();
|
||||
|
||||
Reference in New Issue
Block a user