Skip to content

Commit 6f09370

Browse files
committed
environ on macos uses directly libc which has the correct signature.
1 parent 0157cc9 commit 6f09370

File tree

1 file changed

+1
-4
lines changed
  • library/std/src/sys/unix

1 file changed

+1
-4
lines changed

library/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)