From 991b50f4f992afa03caa682d742ca8df180d3f46 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 6 Sep 2021 09:38:59 +0200 Subject: [PATCH] sys: Fix a few mistakes --- objc/src/runtime.rs | 1 - objc_sys/src/object.rs | 1 - objc_sys/src/various.rs | 12 +++++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/objc/src/runtime.rs b/objc/src/runtime.rs index 36509a217..bb3367197 100644 --- a/objc/src/runtime.rs +++ b/objc/src/runtime.rs @@ -14,7 +14,6 @@ use std::os::raw::c_uint; use crate::Encode; use objc_sys; -#[cfg(target_vendor = "apple")] #[allow(deprecated)] pub use objc_sys::object_dispose; pub use objc_sys::{ diff --git a/objc_sys/src/object.rs b/objc_sys/src/object.rs index c9976869c..c44361b24 100644 --- a/objc_sys/src/object.rs +++ b/objc_sys/src/object.rs @@ -25,7 +25,6 @@ extern "C" { #[cfg(apple)] pub fn object_copy(obj: *const objc_object, size: usize) -> *mut objc_object; #[deprecated = "Not needed since ARC"] - #[cfg(apple)] pub fn object_dispose(obj: *mut objc_object) -> *mut objc_object; #[deprecated = "Not needed since ARC"] pub fn object_setInstanceVariable( diff --git a/objc_sys/src/various.rs b/objc_sys/src/various.rs index 460a1974a..6da437a50 100644 --- a/objc_sys/src/various.rs +++ b/objc_sys/src/various.rs @@ -1,7 +1,7 @@ use core::ffi::c_void; -use std::os::raw::c_char; #[cfg(apple)] -use std::os::raw::{c_int, c_uint}; +use std::os::raw::c_uint; +use std::os::raw::{c_char, c_int}; #[cfg(apple)] use crate::objc_class; @@ -49,11 +49,12 @@ extern "C" { #[cfg(apple)] pub fn objc_copyImageNames(out_len: *mut c_uint) -> *mut *const c_char; + // Instead of being able to change this, it's a weak symbol on GNUStep. #[cfg(apple)] pub fn objc_enumerationMutation(obj: *mut objc_object); #[cfg(apple)] pub fn objc_setEnumerationMutationHandler( - handler: Option, + handler: Option, ); pub fn objc_getAssociatedObject( @@ -70,9 +71,10 @@ extern "C" { #[cfg(apple)] pub fn objc_setForwardHandler(fwd: *mut c_void, fwd_stret: *mut c_void); - #[cfg(apple)] + // These two are defined in: + // - Apple: objc-sync.h + // - GNUStep: dtable.h / associate.m pub fn objc_sync_enter(obj: *mut objc_object) -> c_int; - #[cfg(apple)] pub fn objc_sync_exit(obj: *mut objc_object) -> c_int; /// Not available on macOS x86.