@@ -164,20 +164,14 @@ mod imp {
164164// of this used `[[NSProcessInfo processInfo] arguments]`.
165165#[ cfg( target_vendor = "apple" ) ]
166166mod imp {
167- use crate :: ffi:: { c_char, c_int } ;
167+ use crate :: ffi:: c_char;
168168
169169 pub unsafe fn init ( _argc : isize , _argv : * const * const u8 ) {
170170 // No need to initialize anything in here, `libdyld.dylib` has already
171171 // done the work for us.
172172 }
173173
174174 pub fn argc_argv ( ) -> ( isize , * const * const c_char ) {
175- unsafe extern "C" {
176- // These functions are in crt_externs.h.
177- fn _NSGetArgc ( ) -> * mut c_int ;
178- fn _NSGetArgv ( ) -> * mut * mut * mut c_char ;
179- }
180-
181175 // SAFETY: The returned pointer points to a static initialized early
182176 // in the program lifetime by `libdyld.dylib`, and as such is always
183177 // valid.
@@ -187,9 +181,9 @@ mod imp {
187181 // doesn't exist a lock that we can take. Instead, it is generally
188182 // expected that it's only modified in `main` / before other code
189183 // runs, so reading this here should be fine.
190- let argc = unsafe { _NSGetArgc ( ) . read ( ) } ;
184+ let argc = unsafe { libc :: _NSGetArgc ( ) . read ( ) } ;
191185 // SAFETY: Same as above.
192- let argv = unsafe { _NSGetArgv ( ) . read ( ) } ;
186+ let argv = unsafe { libc :: _NSGetArgv ( ) . read ( ) } ;
193187
194188 // Cast from `*mut *mut c_char` to `*const *const c_char`
195189 ( argc as isize , argv. cast ( ) )
0 commit comments