diff options
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/compiler_builtins.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/compiler_builtins.rs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs b/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs index 100c3b43160..c6a247cf59e 100644 --- a/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs +++ b/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs @@ -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;)* - } +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); + #[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! { |
