archmage 0.9.23

Safely invoke your intrinsic power, using the tokens granted to you by the CPU. Cast primitive magics faster than any mage alive.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// incant! always emits a call to fn_scalar(ScalarToken, ...) as the
// unconditional fallback. If the _scalar function doesn't exist, this
// is a compile error — not a runtime error.

use archmage::incant;

#[cfg(target_arch = "x86_64")]
fn add_v3(_token: archmage::X64V3Token, a: i32, b: i32) -> i32 {
    a + b
}

// No add_scalar defined!

fn main() {
    let _ = incant!(add(1, 2));
}