Created
April 11, 2013 20:13
-
-
Save SiegeLord/5366786 to your computer and use it in GitHub Desktop.
atexit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::libc::c_int; | |
| pub extern "C" | |
| { | |
| fn c_func(atexit_ptr : extern "C" fn(cb : extern "C" fn()) -> c_int) -> bool; | |
| fn atexit(cb : extern "C" fn()) -> c_int; | |
| } | |
| fn main() | |
| { | |
| unsafe | |
| { | |
| c_func(atexit); | |
| } | |
| } | |
| bin.rs:13:15: 13:21 error: mismatched types: expected `extern "C" fn(extern "C" fn()) -> i32` but found `extern "Rust" unsafe fn(extern "C" fn()) -> i32` (expected impure fn but found unsafe fn) | |
| bin.rs:13 c_func(atexit); | |
| ^~~~~~ | |
| error: aborting due to previous error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment