Skip to content

Commit 85680dc

Browse files
committed
Add some Solaris quirks
1 parent 13624c8 commit 85680dc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

libc-test/build.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ fn main() {
3636
} else if windows {
3737
cfg.define("_WIN32_WINNT", Some("0x8000"));
3838
} else if solaris {
39-
cfg.define("_REENTRANT", None);
39+
cfg.define("_XOPEN_SOURCE", Some("700"));
40+
cfg.define("__EXTENSIONS__", None);
41+
cfg.define("_LCONV_C99", None);
4042
}
4143

4244
// Android doesn't actually have in_port_t but it's much easier if we
@@ -567,7 +569,7 @@ fn main() {
567569
"getdtablesize" if android => true,
568570

569571
"dlerror" if android => true, // const-ness is added
570-
"dladdr" if musl => true, // const-ness only added recently
572+
"dladdr" if musl || solaris => true, // const-ness only added recently
571573

572574
// OSX has 'struct tm *const' which we can't actually represent in
573575
// Rust, but is close enough to *mut
@@ -653,7 +655,7 @@ fn main() {
653655
// We can wait for the next major release to be compliant with the new API.
654656
// FIXME: unskip these for next major release
655657
"strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
656-
"setpriority" | "personality" if android => true,
658+
"setpriority" | "personality" if android || solaris => true,
657659
// In Android 64 bits, these functions have been fixed since unified headers.
658660
// Ignore these until next major version.
659661
"bind" | "writev" | "readv" | "sendmsg" | "recvmsg" if android && (aarch64 || x86_64) => true,
@@ -663,6 +665,9 @@ fn main() {
663665

664666
"cfmakeraw" | "cfsetspeed" if solaris => true,
665667

668+
// FIXME: mincore is defined with caddr_t on Solaris.
669+
"mincore" if solaris => true,
670+
666671
_ => false,
667672
}
668673
});

0 commit comments

Comments
 (0)