Skip to content

Commit 15a88f3

Browse files
committed
ucontext usage update on macos 64 bits.
closes rust-lang#2812
1 parent 99756b1 commit 15a88f3

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ fn test_apple(target: &str) {
324324
// macOs 12 minimum
325325
"backtrace_async" => true,
326326

327+
// deprecated api
328+
"getcontext" => true,
329+
327330
_ => false,
328331
}
329332
});

src/unix/bsd/apple/b64/aarch64/align.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ s! {
1515
pub uc_link: *mut ::ucontext_t,
1616
pub uc_mcsize: usize,
1717
pub uc_mcontext: mcontext_t,
18+
__mcontext_data: __darwin_mcontext64,
1819
}
1920

2021
pub struct __darwin_mcontext64 {

src/unix/bsd/apple/b64/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ extern "C" {
109109
path2: *const ::c_char,
110110
options: ::c_uint,
111111
) -> ::c_int;
112+
113+
#[allow(deprecated)]
114+
pub fn getcontext(context: *mut ::ucontext_t) -> ::c_int;
112115
}
113116

114117
cfg_if! {

0 commit comments

Comments
 (0)