File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
16
16
panic_unwind = { path = " ../panic_unwind" , optional = true }
17
17
panic_abort = { path = " ../panic_abort" }
18
18
core = { path = " ../core" }
19
- libc = { version = " 0.2.93 " , default-features = false , features = [' rustc-dep-of-std' ] }
19
+ libc = { version = " 0.2.98 " , default-features = false , features = [' rustc-dep-of-std' ] }
20
20
compiler_builtins = { version = " 0.1.44" }
21
21
profiler_builtins = { path = " ../profiler_builtins" , optional = true }
22
22
unwind = { path = " ../unwind" }
Original file line number Diff line number Diff line change @@ -350,17 +350,14 @@ pub fn current_exe() -> io::Result<PathBuf> {
350
350
351
351
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
352
352
pub fn current_exe ( ) -> io:: Result < PathBuf > {
353
- extern "C" {
354
- fn _NSGetExecutablePath ( buf : * mut libc:: c_char , bufsize : * mut u32 ) -> libc:: c_int ;
355
- }
356
353
unsafe {
357
354
let mut sz: u32 = 0 ;
358
- _NSGetExecutablePath ( ptr:: null_mut ( ) , & mut sz) ;
355
+ libc :: _NSGetExecutablePath ( ptr:: null_mut ( ) , & mut sz) ;
359
356
if sz == 0 {
360
357
return Err ( io:: Error :: last_os_error ( ) ) ;
361
358
}
362
359
let mut v: Vec < u8 > = Vec :: with_capacity ( sz as usize ) ;
363
- let err = _NSGetExecutablePath ( v. as_mut_ptr ( ) as * mut i8 , & mut sz) ;
360
+ let err = libc :: _NSGetExecutablePath ( v. as_mut_ptr ( ) as * mut i8 , & mut sz) ;
364
361
if err != 0 {
365
362
return Err ( io:: Error :: last_os_error ( ) ) ;
366
363
}
You can’t perform that action at this time.
0 commit comments