@@ -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 ,
@@ -5826,6 +5835,7 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
58265835 || defined(BUILD_TARGET_AARCH64 ) || defined(BUILD_TARGET_RISCV64_LP64D ) \
58275836 || defined(BUILD_TARGET_RISCV64_LP64 )
58285837
5838+
58295839#if WASM_ENABLE_SIMD != 0
58305840#ifdef v128
58315841#undef v128
@@ -6249,6 +6259,8 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
62496259 || defined(BUILD_TARGET_RISCV64_LP64D) \
62506260 || defined(BUILD_TARGET_RISCV64_LP64) */
62516261
6262+ #endif /* end of WASM_ENABLE_INVOKE_NATIVE != 0 */
6263+
62526264bool
62536265wasm_runtime_call_indirect (WASMExecEnv * exec_env , uint32 element_index ,
62546266 uint32 argc , uint32 argv [])
@@ -7426,8 +7438,12 @@ bool
74267438wasm_runtime_is_import_func_linked (const char * module_name ,
74277439 const char * func_name )
74287440{
7441+ #if WASM_EANBLE_INVOKE_NATIVE != 0
74297442 return wasm_native_resolve_symbol (module_name , func_name , NULL , NULL , NULL ,
74307443 NULL );
7444+ #else
7445+ return false;
7446+ #endif
74317447}
74327448
74337449bool
0 commit comments