labast/test/native_test.rs

13 lines
387 B
Rust
Raw Normal View History

2024-06-16 23:14:13 +00:00
// Build with
// rustc --crate-type cdylib native_test.rs -o native_test.so
// or
// rustc --crate-type cdylib native_test.rs -o native_test.dll
#[no_mangle]
2024-06-18 21:45:16 +00:00
unsafe extern "C" fn labashka(pop: extern fn() -> u16, push: extern fn(u16), len: extern fn () -> usize, max: usize) {
2024-06-16 23:14:13 +00:00
println!("At {}, there's {}.", len(), pop());
push(12);
println!("Maximum size is {}.", max);
}