bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.96k stars 624 forks source link

How to use the native API with int64 parameters? #3698

Open kamylee opened 3 months ago

kamylee commented 3 months ago

I do it like this: "Native_fdb_tsl_iter_by_time", // the name of WASM function name (void*)Native_fdb_tsl_iter_by_time, // the native function pointer "(II)i" // the function prototype signature },

int Native_fdb_tsl_iter_by_time(wasm_exec_env_t exec_env, /*uint64_t*/signed long int pfrom_time, signed long int pto_time) {...} The function declaration in WASM is as follows: int Native_fdb_tsl_iter_by_time(unsigned long int pfrom_time, unsigned long int pto_time);

It compiles successfully,But a error occurs runtime: Exception: failed to call unlinked import function (env, Native_fdb_tsl_iter_by_time)

What should i do to fix it?

kamylee commented 3 months ago

it works fine if i use int32(ii).