Skip to content

Commit 7c10ced

Browse files
committed
environ on macos uses directly libc which has the correct signature.
1 parent 82ac8a8 commit 7c10ced

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

std/src/sys/unix/os.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,7 @@ impl Iterator for Env {
472472

473473
#[cfg(target_os = "macos")]
474474
pub unsafe fn environ() -> *mut *const *const c_char {
475-
extern "C" {
476-
fn _NSGetEnviron() -> *mut *const *const c_char;
477-
}
478-
_NSGetEnviron()
475+
libc::_NSGetEnviron() as *mut *const *const c_char
479476
}
480477

481478
#[cfg(not(target_os = "macos"))]

0 commit comments

Comments
 (0)