#libc #deal #macro #typedef #phase #hell

checked_cast

A small macro to deal with the libc typedef hell

3 releases

Uses old Rust 2015

0.0.3 Jan 19, 2015
0.0.2 Dec 21, 2014
0.0.1 Dec 13, 2014

#5 in #typedef


Used in allocator

MIT/Apache

3KB

A small macro to deal with the libc typedef hell.

Build Status

#![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

No runtime deps