Merge commit '370c397ec9
' into sync_cg_clif-2022-03-20
This commit is contained in:
commit
ef4ce72919
32 changed files with 462 additions and 515 deletions
|
@ -1,16 +1,18 @@
|
|||
macro builtin_functions($register:ident; $(fn $name:ident($($arg_name:ident: $arg_ty:ty),*) -> $ret_ty:ty;)*) {
|
||||
#[cfg(feature = "jit")]
|
||||
#[allow(improper_ctypes)]
|
||||
extern "C" {
|
||||
$(fn $name($($arg_name: $arg_ty),*) -> $ret_ty;)*
|
||||
}
|
||||
|
||||
#[cfg(feature = "jit")]
|
||||
pub(crate) fn $register(builder: &mut cranelift_jit::JITBuilder) {
|
||||
for (name, val) in [$((stringify!($name), $name as *const u8)),*] {
|
||||
builder.symbol(name, val);
|
||||
macro_rules! builtin_functions {
|
||||
($register:ident; $(fn $name:ident($($arg_name:ident: $arg_ty:ty),*) -> $ret_ty:ty;)*) => {
|
||||
#[cfg(feature = "jit")]
|
||||
#[allow(improper_ctypes)]
|
||||
extern "C" {
|
||||
$(fn $name($($arg_name: $arg_ty),*) -> $ret_ty;)*
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "jit")]
|
||||
pub(crate) fn $register(builder: &mut cranelift_jit::JITBuilder) {
|
||||
for (name, val) in [$((stringify!($name), $name as *const u8)),*] {
|
||||
builder.symbol(name, val);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
builtin_functions! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue