Skip to content

Commit 85254d8

Browse files
committed
Fix GNUStep imports
1 parent a275174 commit 85254d8

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

objc/src/runtime.rs

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

1616
use objc_sys;
17+
#[cfg(target_vendor = "apple")]
1718
#[allow(deprecated)]
1819
pub use objc_sys::object_dispose;
1920
pub use objc_sys::{

objc_sys/src/constants.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//! Various common #defines and enum constants.
22
3+
#[cfg(apple)]
34
use std::os::raw::c_int;
45

5-
use super::{id, Class, BOOL};
6+
use crate::{id, Class, BOOL};
67

78
/// The equivalent of true for Objective-C's [`BOOL`][`super::BOOL`] type.
89
#[cfg(not(target_arch = "aarch64"))]

objc_sys/src/exception.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
//! GNUStep: `eh_personality.c`, which is a bit brittle to rely on, but I
44
//! think it's fine...
55
use core::ffi::c_void;
6+
#[cfg(any(apple, gnustep))]
67
use std::os::raw::c_int;
78

8-
use crate::{objc_class, objc_object};
9+
#[cfg(apple)]
10+
use crate::objc_class;
11+
use crate::objc_object;
912

1013
/// Remember that this is non-null!
1114
#[cfg(apple)]

objc_sys/src/message.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
//! Most of these are `cfg`-gated, these configs are semver-stable.
44
//!
55
//! TODO: Some of these are only supported on _some_ GNUStep targets!
6-
use super::{objc_class, objc_object};
6+
use crate::{objc_class, objc_object};
7+
#[cfg(gnustep)]
8+
use crate::{objc_selector, IMP};
79

810
/// Specifies data used when sending messages to superclasses.
911
#[repr(C)]
@@ -21,7 +23,7 @@ pub struct objc_super {
2123
#[cfg(gnustep)]
2224
extern "C" {
2325
pub fn objc_msg_lookup(receiver: *mut objc_object, sel: *const objc_selector) -> IMP;
24-
pub fn objc_msg_lookup_super(super: *const objc_super, sel: *const objc_selector) -> IMP;
26+
pub fn objc_msg_lookup_super(sup: *const objc_super, sel: *const objc_selector) -> IMP;
2527
// objc_msg_lookup_sender
2628
}
2729

objc_sys/src/various.rs

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

4-
use crate::{objc_AssociationPolicy, objc_class, objc_object, OpaqueData, BOOL};
6+
#[cfg(apple)]
7+
use crate::objc_class;
8+
use crate::{objc_AssociationPolicy, objc_object, OpaqueData, BOOL};
59

610
/// A type that represents an instance variable.
711
#[repr(C)]

0 commit comments

Comments
 (0)