about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid CARLIER <devnexen@gmail.com>2021-10-07 20:47:17 +0100
committerDavid CARLIER <devnexen@gmail.com>2021-10-07 20:47:17 +0100
commit6f09370028341778c07d822c2c59947bed30fa90 (patch)
tree7df7e6d10a79d9c2009c8399a6ba76b098da3234
parent0157cc977fd71297ce73e2f249321f5ba2555d42 (diff)
downloadrust-6f09370028341778c07d822c2c59947bed30fa90.tar.gz
rust-6f09370028341778c07d822c2c59947bed30fa90.zip
environ on macos uses directly libc which has the correct signature.
-rw-r--r--library/std/src/sys/unix/os.rs5
1 files changed, 1 insertions, 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"))]