Skip to content

Commit 991b50f

Browse files
committed
sys: Fix a few mistakes
1 parent 216b1b4 commit 991b50f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

objc/src/runtime.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::os::raw::c_uint;
1414
use crate::Encode;
1515

1616
use objc_sys;
17-
#[cfg(target_vendor = "apple")]
1817
#[allow(deprecated)]
1918
pub use objc_sys::object_dispose;
2019
pub use objc_sys::{

objc_sys/src/object.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ extern "C" {
2525
#[cfg(apple)]
2626
pub fn object_copy(obj: *const objc_object, size: usize) -> *mut objc_object;
2727
#[deprecated = "Not needed since ARC"]
28-
#[cfg(apple)]
2928
pub fn object_dispose(obj: *mut objc_object) -> *mut objc_object;
3029
#[deprecated = "Not needed since ARC"]
3130
pub fn object_setInstanceVariable(

objc_sys/src/various.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::ffi::c_void;
2-
use std::os::raw::c_char;
32
#[cfg(apple)]
4-
use std::os::raw::{c_int, c_uint};
3+
use std::os::raw::c_uint;
4+
use std::os::raw::{c_char, c_int};
55

66
#[cfg(apple)]
77
use crate::objc_class;
@@ -49,11 +49,12 @@ extern "C" {
4949
#[cfg(apple)]
5050
pub fn objc_copyImageNames(out_len: *mut c_uint) -> *mut *const c_char;
5151

52+
// Instead of being able to change this, it's a weak symbol on GNUStep.
5253
#[cfg(apple)]
5354
pub fn objc_enumerationMutation(obj: *mut objc_object);
5455
#[cfg(apple)]
5556
pub fn objc_setEnumerationMutationHandler(
56-
handler: Option<unsafe extern "C" fn(arg1: *mut objc_object)>,
57+
handler: Option<unsafe extern "C" fn(obj: *mut objc_object)>,
5758
);
5859

5960
pub fn objc_getAssociatedObject(
@@ -70,9 +71,10 @@ extern "C" {
7071

7172
#[cfg(apple)]
7273
pub fn objc_setForwardHandler(fwd: *mut c_void, fwd_stret: *mut c_void);
73-
#[cfg(apple)]
74+
// These two are defined in:
75+
// - Apple: objc-sync.h
76+
// - GNUStep: dtable.h / associate.m
7477
pub fn objc_sync_enter(obj: *mut objc_object) -> c_int;
75-
#[cfg(apple)]
7678
pub fn objc_sync_exit(obj: *mut objc_object) -> c_int;
7779

7880
/// Not available on macOS x86.

0 commit comments

Comments
 (0)