diff options
Diffstat (limited to 'libc-test')
-rw-r--r-- | libc-test/build.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index d7ee75b949..b983819671 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -10,6 +10,7 @@ fn main() { let mingw = target.contains("windows-gnu"); let linux = target.contains("unknown-linux"); let android = target.contains("android"); + let darwin = target.contains("apple-darwin"); let mut cfg = ctest::TestGenerator::new(); // Pull in extra goodies on linux/mingw @@ -37,7 +38,7 @@ fn main() { .header("time.h") .header("wchar.h"); - if target.contains("apple-darwin") { + if darwin { cfg.header("mach-o/dyld.h"); cfg.header("mach/mach_time.h"); } else if linux || android { @@ -82,7 +83,6 @@ fn main() { cfg.header("utime.h"); cfg.header("pwd.h"); cfg.header("grp.h"); - cfg.header("malloc.h"); if android { cfg.header("arpa/inet.h"); @@ -93,6 +93,13 @@ fn main() { cfg.header("execinfo.h"); } + if darwin { + cfg.header("malloc/malloc.h"); + cfg.header("crt_externs.h"); + } else { + cfg.header("malloc.h"); + } + } if target.contains("linux") { cfg.header("sys/prctl.h"); @@ -108,6 +115,9 @@ fn main() { "time64_t" if windows => "__time64_t".to_string(), "ssize_t" if windows => "SSIZE_T".to_string(), + // OSX calls this something else + "sighandler_t" if darwin => "sig_t".to_string(), + t if t.ends_with("_t") => t.to_string(), // Windows uppercase structs don't have `struct` in front, there's a |