Created
June 25, 2015 13:44
-
-
Save dnaeon/4b5d727ac2d079253840 to your computer and use it in GitHub Desktop.
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
/* Example C header file for libtest */ | |
... | |
#define LIB_VERSION 1 | |
... | |
/* End of header file */ | |
// Example Rust code | |
extern crate libc; | |
#[link(name = "libtest")] | |
extern { | |
static LIB_VERSION: libc::c_int; | |
} | |
fn main() { | |
println!("Version is {}", LIB_VERSION as i32); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment