A small macro to deal with the libc typedef hell.
#![feature(phase)] extern crate core; #[phase(plugin)] extern crate checked_cast; let foo: c_long = -1; let bar: c_uint = checked_cast!(foo, c_uint).unwrap(); // panic