aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2022-05-30-cmake-cargo-example/libcalc/src/lib.rs
blob: a36aacef37e2e247d768b179c70ff785c99d0507 (plain) (blame)
1
2
3
4
5
6
7
8
9
#[no_mangle]
pub extern "C" fn wrap_add(a: i32, b: i32) -> i32 {
    a.wrapping_add(b)
}

#[no_mangle]
pub extern "C" fn sat_add(a: i32, b: i32) -> i32 {
    a.saturating_add(b)
}