From cc39e217e78b1b0a1ffaa0c55e8a2e78a5f0074b Mon Sep 17 00:00:00 2001 From: Nikolai Vazquez Date: Mon, 7 Dec 2020 01:38:32 -0500 Subject: [PATCH] Comment on future use of "C-unwind" ABI (issue #7) --- src/foundation/ns_exception/mod.rs | 2 +- src/objc/msg/get_fn.rs | 1 + src/objc/msg/mod.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/foundation/ns_exception/mod.rs b/src/foundation/ns_exception/mod.rs index af6aebd..9ae02cc 100644 --- a/src/foundation/ns_exception/mod.rs +++ b/src/foundation/ns_exception/mod.rs @@ -61,8 +61,8 @@ impl NSException { /// See [documentation](https://developer.apple.com/documentation/foundation/nsexception/1416135-raise). #[inline] pub fn raise(&self) -> ! { + // TODO(#7): Use "C-unwind" ABI when stable. extern "C" { - // TODO: Define unwind ABI. fn objc_exception_throw(exception: &NSException) -> !; } unsafe { objc_exception_throw(self) } diff --git a/src/objc/msg/get_fn.rs b/src/objc/msg/get_fn.rs index 7d57cad..db5cf72 100644 --- a/src/objc/msg/get_fn.rs +++ b/src/objc/msg/get_fn.rs @@ -1,6 +1,7 @@ #[allow(unused)] use std::{any::TypeId, mem}; +// TODO(#7): Use "C-unwind" ABI when stable. #[allow(unused)] extern "C" { fn objc_msgSend(); diff --git a/src/objc/msg/mod.rs b/src/objc/msg/mod.rs index 24c7694..9ba1131 100644 --- a/src/objc/msg/mod.rs +++ b/src/objc/msg/mod.rs @@ -85,6 +85,7 @@ macro_rules! impl_msg_args_base { sel: SEL, ($($arg,)*): Self, ) -> Ret { + // TODO(#7): Use "C-unwind" ABI when stable. let msg_send: unsafe extern "C" fn(*const c_void, SEL $(, $arg)*) -> Ret = mem::transmute(get_fn::msg_send_fn::());