Skip to content

Commit 7380d0f

Browse files
author
Jorge Aparicio
committed
osx: link to dylib, windows: always return None
1 parent 9493c37 commit 7380d0f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

gcc_s/src/lib.rs

+17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ use libloading::Library;
88

99
static mut GCC_S: Option<Library> = None;
1010

11+
#[cfg(not(windows))]
1112
fn gcc_s() -> &'static Library {
13+
#[cfg(not(target_os = "macos"))]
14+
const LIBGCC_S: &'static = "libgcc_s.so.1";
15+
16+
#[cfg(target_os = "macos")]
17+
const LIBGCC_S: &'static = "libgcc_s.1.dylib";
18+
1219
unsafe {
1320
static INIT: Once = ONCE_INIT;
1421

@@ -19,6 +26,16 @@ fn gcc_s() -> &'static Library {
1926
}
2027
}
2128

29+
#[cfg(windows)]
30+
macro_rules! declare {
31+
($symbol:ident: fn($($i:ty),+) -> $o:ty) => {
32+
pub fn $symbol() -> Option<unsafe extern fn($($i),+) -> $o> {
33+
None
34+
}
35+
}
36+
}
37+
38+
#[cfg(not(windows))]
2239
macro_rules! declare {
2340
($symbol:ident: fn($($i:ty),+) -> $o:ty) => {
2441
pub fn $symbol() -> Option<unsafe extern fn($($i),+) -> $o> {

0 commit comments

Comments
 (0)