re-org platform APIs, simplify porting process (#201)

Co-authored-by: Xu Jun <jun1.xu@intel.com>
This commit is contained in:
Xu Jun
2020-03-16 16:43:57 +08:00
committed by GitHub
parent ef5ceffe71
commit f1a0e75ab7
177 changed files with 2954 additions and 7904 deletions

View File

@ -7,7 +7,6 @@
#include <string.h>
#include "bh_platform.h"
#include "bh_log.h"
#include "bh_platform_log.h"
#include "wasm_export.h"
#include "test_wasm.h"
@ -35,7 +34,7 @@ app_instance_main(wasm_module_inst_t module_inst)
wasm_application_execute_main(module_inst, app_argc, app_argv);
if ((exception = wasm_runtime_get_exception(module_inst)))
bh_printf("%s\n", exception);
printf("%s\n", exception);
return NULL;
}
@ -63,7 +62,7 @@ void iwasm_main(void *arg1)
/* initialize runtime environment */
if (!wasm_runtime_full_init(&init_args)) {
bh_printf("Init runtime environment failed.\n");
printf("Init runtime environment failed.\n");
return;
}
@ -78,7 +77,7 @@ void iwasm_main(void *arg1)
/* load WASM module */
if (!(wasm_module = wasm_runtime_load(wasm_file_buf, wasm_file_size,
error_buf, sizeof(error_buf)))) {
bh_printf("%s\n", error_buf);
printf("%s\n", error_buf);
goto fail1;
}
@ -88,7 +87,7 @@ void iwasm_main(void *arg1)
8 * 1024,
error_buf,
sizeof(error_buf)))) {
bh_printf("%s\n", error_buf);
printf("%s\n", error_buf);
goto fail2;
}