Skip to content

Commit 6804487

Browse files
committed
Implement MethodImplementation for unsafe function pointers
1 parent d3dc9e5 commit 6804487

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

objc2/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1818
* Consistently allow trailing commas in `msg_send!`.
1919
* Added `msg_send_bool!`, a less error-prone version of `msg_send!` for
2020
Objective-C methods that return `BOOL`.
21+
* Implemented `MethodImplementation` for `unsafe` function pointers.
2122

2223
### Changed
2324
* **BREAKING**: Changed signature of `Id::new` and `Id::retain` from

objc2/src/declare.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ macro_rules! method_decl_impl {
7878
($($t:ident),*) => (
7979
method_decl_impl!(-T, R, extern "C" fn(&T, Sel $(, $t)*) -> R, $($t),*);
8080
method_decl_impl!(-T, R, extern "C" fn(&mut T, Sel $(, $t)*) -> R, $($t),*);
81+
method_decl_impl!(-T, R, unsafe extern "C" fn(*const T, Sel $(, $t)*) -> R, $($t),*);
82+
method_decl_impl!(-T, R, unsafe extern "C" fn(*mut T, Sel $(, $t)*) -> R, $($t),*);
83+
method_decl_impl!(-T, R, unsafe extern "C" fn(&T, Sel $(, $t)*) -> R, $($t),*);
84+
method_decl_impl!(-T, R, unsafe extern "C" fn(&mut T, Sel $(, $t)*) -> R, $($t),*);
8185
);
8286
}
8387

0 commit comments

Comments
 (0)