From 6f09370028341778c07d822c2c59947bed30fa90 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Thu, 7 Oct 2021 20:47:17 +0100 Subject: [PATCH] environ on macos uses directly libc which has the correct signature. --- library/std/src/sys/unix/os.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/unix/os.rs index 87893d26912..a596fc67671 100644 --- a/library/std/src/sys/unix/os.rs +++ b/library/std/src/sys/unix/os.rs @@ -472,10 +472,7 @@ impl Iterator for Env { #[cfg(target_os = "macos")] pub unsafe fn environ() -> *mut *const *const c_char { - extern "C" { - fn _NSGetEnviron() -> *mut *const *const c_char; - } - _NSGetEnviron() + libc::_NSGetEnviron() as *mut *const *const c_char } #[cfg(not(target_os = "macos"))]