Skip to content

Commit 8fa9f75

Browse files
authored
Merge pull request #43 from jarod/issue_42
explicit convert dlopen parameter filename to *const c_char
2 parents 048894c + 7733b54 commit 8fa9f75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dylib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::marker;
33
use std::mem;
44
use std::sync::atomic::{AtomicUsize, Ordering};
55

6-
use libc::{self, c_void};
6+
use libc::{self, c_char, c_void};
77

88
pub struct Dylib {
99
pub init: AtomicUsize,
@@ -27,7 +27,7 @@ impl Dylib {
2727
return true
2828
}
2929
let name = CString::new(path).unwrap();
30-
let ptr = libc::dlopen(name.as_ptr(), libc::RTLD_LAZY);
30+
let ptr = libc::dlopen(name.as_ptr() as *const c_char, libc::RTLD_LAZY);
3131
if ptr.is_null() {
3232
return false
3333
}

0 commit comments

Comments
 (0)