From d2eed27ec63b6f0058da8d0a3877f2cf358eeecf Mon Sep 17 00:00:00 2001 From: michaelwright235 Date: Fri, 2 Jun 2023 10:01:10 +0300 Subject: [PATCH] sys: runloop: Implement platform dependent variants of 2 fields of CFRunLoopSourceContext1 structure. --- core-foundation-sys/src/runloop.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core-foundation-sys/src/runloop.rs b/core-foundation-sys/src/runloop.rs index 0332f52..387d9c1 100644 --- a/core-foundation-sys/src/runloop.rs +++ b/core-foundation-sys/src/runloop.rs @@ -71,9 +71,16 @@ pub struct CFRunLoopSourceContext1 { pub copyDescription: Option CFStringRef>, pub equal: Option Boolean>, pub hash: Option CFHashCode>, - // note that the following two fields are platform dependent in the C header, the ones here are for macOS + + #[cfg(any(target_os="macos", target_os="ios"))] pub getPort: extern "C" fn (info: *mut c_void) -> mach_port_t, + #[cfg(any(target_os="macos", target_os="ios"))] pub perform: extern "C" fn (msg: *mut c_void, size: CFIndex, allocator: CFAllocatorRef, info: *mut c_void) -> *mut c_void, + + #[cfg(not(any(target_os="macos", target_os="ios")))] + pub getPort: extern "C" fn (info: *mut c_void) -> *mut c_void, + #[cfg(not(any(target_os="macos", target_os="ios")))] + pub perform: extern "C" fn (info: *mut c_void) -> *mut c_void, } #[repr(C)]