2013-02-27 19:53:31 -08:00
|
|
|
use core::unstable::run_in_bare_thread;
|
2013-01-11 18:32:46 -08:00
|
|
|
|
|
|
|
extern {
|
|
|
|
pub fn rust_dbg_call(cb: *u8,
|
|
|
|
data: libc::uintptr_t) -> libc::uintptr_t;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
unsafe {
|
|
|
|
do run_in_bare_thread() {
|
|
|
|
unsafe {
|
|
|
|
let i = &100;
|
|
|
|
rust_dbg_call(callback, cast::transmute(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extern fn callback(data: libc::uintptr_t) {
|
|
|
|
unsafe {
|
|
|
|
let data: *int = cast::transmute(data);
|
2013-03-28 18:39:09 -07:00
|
|
|
assert!(*data == 100);
|
2013-01-11 18:32:46 -08:00
|
|
|
}
|
2013-02-14 11:47:00 -08:00
|
|
|
}
|