Skip to content

Commit

Permalink
ucontext usage update on macos 64 bits.
Browse files Browse the repository at this point in the history
closes #2812
  • Loading branch information
devnexen committed Jun 4, 2022
1 parent 99756b1 commit ed28db1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ fn test_apple(target: &str) {
// macOs 12 minimum
"backtrace_async" => true,

// deprecated api
"getcontext" => true,

_ => false,
}
});
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/apple/b64/aarch64/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ s! {
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t,
__mcontext_data: __darwin_mcontext64,
}

pub struct __darwin_mcontext64 {
Expand Down
5 changes: 5 additions & 0 deletions src/unix/bsd/apple/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ s_no_extra_traits! {
}
}

extern "C" {
#[allow(deprecated)]
pub fn getcontext(context: *mut ::ucontext_t) -> ::c_int;
}

cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_attr_t {
Expand Down

0 comments on commit ed28db1

Please sign in to comment.