@@ -460,9 +460,11 @@ wasm_runtime_env_init(void)
460460 if (bh_platform_init () != 0 )
461461 return false;
462462
463+ #if WASM_ENABLE_INVOKE_NATIVE != 0
463464 if (wasm_native_init () == false) {
464465 goto fail1 ;
465466 }
467+ #endif
466468
467469#if WASM_ENABLE_MULTI_MODULE
468470 if (BHT_OK != os_mutex_init (& registered_module_list_lock )) {
@@ -572,7 +574,9 @@ wasm_runtime_env_init(void)
572574 os_mutex_destroy (& registered_module_list_lock );
573575fail2 :
574576#endif
577+ #if WASM_ENABLE_INVOKE_NATIVE != 0
575578 wasm_native_destroy ();
579+ #endif
576580fail1 :
577581 bh_platform_destroy ();
578582
@@ -694,7 +698,9 @@ wasm_runtime_destroy_internal(void)
694698 thread_manager_destroy ();
695699#endif
696700
701+ #if WASM_ENABLE_INVOKE_NATIVE != 0
697702 wasm_native_destroy ();
703+ #endif
698704 bh_platform_destroy ();
699705
700706 wasm_runtime_memory_destroy ();
@@ -791,13 +797,15 @@ wasm_runtime_full_init_internal(RuntimeInitArgs *init_args)
791797 }
792798#endif
793799
800+ #if WASM_ENABLE_INVOKE_NATIVE != 0
794801 if (init_args -> n_native_symbols > 0
795802 && !wasm_runtime_register_natives (init_args -> native_module_name ,
796803 init_args -> native_symbols ,
797804 init_args -> n_native_symbols )) {
798805 wasm_runtime_destroy ();
799806 return false;
800807 }
808+ #endif
801809
802810#if WASM_ENABLE_THREAD_MGR != 0
803811 wasm_cluster_set_max_thread_num (init_args -> max_thread_num );
@@ -4721,6 +4729,7 @@ wasm_table_type_get_max_size(WASMTableType *const table_type)
47214729 return table_type -> max_size ;
47224730}
47234731
4732+ #if WASM_ENABLE_INVOKE_NATIVE != 0
47244733bool
47254734wasm_runtime_register_natives (const char * module_name ,
47264735 NativeSymbol * native_symbols ,
@@ -6249,6 +6258,8 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
62496258 || defined(BUILD_TARGET_RISCV64_LP64D) \
62506259 || defined(BUILD_TARGET_RISCV64_LP64) */
62516260
6261+ #endif /* end of WASM_ENABLE_INVOKE_NATIVE != 0 */
6262+
62526263bool
62536264wasm_runtime_call_indirect (WASMExecEnv * exec_env , uint32 element_index ,
62546265 uint32 argc , uint32 argv [])
@@ -7426,8 +7437,12 @@ bool
74267437wasm_runtime_is_import_func_linked (const char * module_name ,
74277438 const char * func_name )
74287439{
7440+ #if WASM_EANBLE_INVOKE_NATIVE != 0
74297441 return wasm_native_resolve_symbol (module_name , func_name , NULL , NULL , NULL ,
74307442 NULL );
7443+ #else
7444+ return false;
7445+ #endif
74317446}
74327447
74337448bool
0 commit comments