mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 15:41:33 +00:00
feat(runtime-c-api) Extract the value
module.
This commit is contained in:
29
lib/runtime-c-api/src/value.rs
Normal file
29
lib/runtime-c-api/src/value.rs
Normal file
@ -0,0 +1,29 @@
|
||||
//! Wasm values.
|
||||
|
||||
use libc::{int32_t, int64_t};
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
#[repr(u32)]
|
||||
#[derive(Clone)]
|
||||
pub enum wasmer_value_tag {
|
||||
WASM_I32,
|
||||
WASM_I64,
|
||||
WASM_F32,
|
||||
WASM_F64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub union wasmer_value {
|
||||
pub I32: int32_t,
|
||||
pub I64: int64_t,
|
||||
pub F32: f32,
|
||||
pub F64: f64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
pub struct wasmer_value_t {
|
||||
pub tag: wasmer_value_tag,
|
||||
pub value: wasmer_value,
|
||||
}
|
Reference in New Issue
Block a user