Skip to content

Commit

Permalink
fix ptr cast
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Jun 2, 2023
1 parent f212ba6 commit 2f459f7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions library/std/src/sys/unix/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,15 @@ mod imp {
let mut res = Vec::new();

unsafe {
let process_info_sel = sel_registerName(c"processInfo".as_ptr());
let arguments_sel = sel_registerName(c"arguments".as_ptr());
let utf8_sel = sel_registerName(c"UTF8String".as_ptr());
let count_sel = sel_registerName(c"count".as_ptr());
let object_at_sel = sel_registerName(c"objectAtIndex:".as_ptr());

let klass = objc_getClass(c"NSProcessInfo".as_ptr());
let process_info_sel =
sel_registerName(c"processInfo".as_ptr() as *const libc::c_uchar);
let arguments_sel = sel_registerName(c"arguments".as_ptr() as *const libc::c_uchar);
let utf8_sel = sel_registerName(c"UTF8String".as_ptr() as *const libc::c_uchar);
let count_sel = sel_registerName(c"count".as_ptr() as *const libc::c_uchar);
let object_at_sel =
sel_registerName(c"objectAtIndex:".as_ptr() as *const libc::c_uchar);

let klass = objc_getClass(c"NSProcessInfo".as_ptr() as *const libc::c_uchar);
let info = objc_msgSend(klass, process_info_sel);
let args = objc_msgSend(info, arguments_sel);

Expand Down

0 comments on commit 2f459f7

Please sign in to comment.