@@ -460,9 +460,11 @@ wasm_runtime_env_init(void)
460
460
if (bh_platform_init () != 0 )
461
461
return false;
462
462
463
+ #if WASM_ENABLE_INVOKE_NATIVE != 0
463
464
if (wasm_native_init () == false) {
464
465
goto fail1 ;
465
466
}
467
+ #endif
466
468
467
469
#if WASM_ENABLE_MULTI_MODULE
468
470
if (BHT_OK != os_mutex_init (& registered_module_list_lock )) {
@@ -572,7 +574,9 @@ wasm_runtime_env_init(void)
572
574
os_mutex_destroy (& registered_module_list_lock );
573
575
fail2 :
574
576
#endif
577
+ #if WASM_ENABLE_INVOKE_NATIVE != 0
575
578
wasm_native_destroy ();
579
+ #endif
576
580
fail1 :
577
581
bh_platform_destroy ();
578
582
@@ -694,7 +698,9 @@ wasm_runtime_destroy_internal(void)
694
698
thread_manager_destroy ();
695
699
#endif
696
700
701
+ #if WASM_ENABLE_INVOKE_NATIVE != 0
697
702
wasm_native_destroy ();
703
+ #endif
698
704
bh_platform_destroy ();
699
705
700
706
wasm_runtime_memory_destroy ();
@@ -791,13 +797,15 @@ wasm_runtime_full_init_internal(RuntimeInitArgs *init_args)
791
797
}
792
798
#endif
793
799
800
+ #if WASM_ENABLE_INVOKE_NATIVE != 0
794
801
if (init_args -> n_native_symbols > 0
795
802
&& !wasm_runtime_register_natives (init_args -> native_module_name ,
796
803
init_args -> native_symbols ,
797
804
init_args -> n_native_symbols )) {
798
805
wasm_runtime_destroy ();
799
806
return false;
800
807
}
808
+ #endif
801
809
802
810
#if WASM_ENABLE_THREAD_MGR != 0
803
811
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)
4721
4729
return table_type -> max_size ;
4722
4730
}
4723
4731
4732
+ #if WASM_ENABLE_INVOKE_NATIVE != 0
4724
4733
bool
4725
4734
wasm_runtime_register_natives (const char * module_name ,
4726
4735
NativeSymbol * native_symbols ,
@@ -5826,6 +5835,7 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
5826
5835
|| defined(BUILD_TARGET_AARCH64 ) || defined(BUILD_TARGET_RISCV64_LP64D ) \
5827
5836
|| defined(BUILD_TARGET_RISCV64_LP64 )
5828
5837
5838
+
5829
5839
#if WASM_ENABLE_SIMD != 0
5830
5840
#ifdef v128
5831
5841
#undef v128
@@ -6249,6 +6259,8 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
6249
6259
|| defined(BUILD_TARGET_RISCV64_LP64D) \
6250
6260
|| defined(BUILD_TARGET_RISCV64_LP64) */
6251
6261
6262
+ #endif /* end of WASM_ENABLE_INVOKE_NATIVE != 0 */
6263
+
6252
6264
bool
6253
6265
wasm_runtime_call_indirect (WASMExecEnv * exec_env , uint32 element_index ,
6254
6266
uint32 argc , uint32 argv [])
@@ -7426,8 +7438,12 @@ bool
7426
7438
wasm_runtime_is_import_func_linked (const char * module_name ,
7427
7439
const char * func_name )
7428
7440
{
7441
+ #if WASM_EANBLE_INVOKE_NATIVE != 0
7429
7442
return wasm_native_resolve_symbol (module_name , func_name , NULL , NULL , NULL ,
7430
7443
NULL );
7444
+ #else
7445
+ return false;
7446
+ #endif
7431
7447
}
7432
7448
7433
7449
bool
0 commit comments