Basic library initialization
This commit is contained in:
parent
97713dfaf5
commit
6afafafe60
|
|
@ -0,0 +1,4 @@
|
||||||
|
/.rust/
|
||||||
|
/bin/
|
||||||
|
/build/
|
||||||
|
/lib/
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
mod ffi {
|
||||||
|
use std::libc::{c_int};
|
||||||
|
|
||||||
|
#[link_args = "-lssl"]
|
||||||
|
extern "C" {
|
||||||
|
fn SSL_library_init() -> c_int;
|
||||||
|
fn SSL_load_error_strings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[fixed_stack_segment]
|
||||||
|
pub fn init() {
|
||||||
|
unsafe {
|
||||||
|
ffi::SSL_library_init();
|
||||||
|
ffi::SSL_load_error_strings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
extern mod ssl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_init_works() {
|
||||||
|
ssl::init();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue