Fix build on i686-apple-darwin systems

On 32-bit systems, fdopendir is called `_fdopendir$INODE64$UNIX2003`.
On 64-bit systems, fdopendir is called `_fdopendir$INODE64`.
This commit is contained in:
Marcus Calhoun-Lopez 2022-03-28 12:44:19 -07:00
parent c2d5c64132
commit 8c18844324

View file

@ -1562,6 +1562,9 @@ mod remove_dir_impl {
}
pub unsafe fn fdopendir(fd: c_int) -> *mut DIR {
#[cfg(all(target_os = "macos", target_arch = "x86"))]
weak!(fn fdopendir(c_int) -> *mut DIR, "fdopendir$INODE64$UNIX2003");
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
weak!(fn fdopendir(c_int) -> *mut DIR, "fdopendir$INODE64");
fdopendir.get().map(|fdopendir| fdopendir(fd)).unwrap_or_else(|| {
crate::sys::unix::os::set_errno(libc::ENOSYS);