Skip to content

Commit

Permalink
sys: Fix GNUStep imports
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 6, 2021
1 parent a275174 commit 216b1b4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions objc/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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::{
Expand Down
3 changes: 2 additions & 1 deletion objc_sys/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! Various common #defines and enum constants.

#[cfg(apple)]
use std::os::raw::c_int;

use super::{id, Class, BOOL};
use crate::{id, Class, BOOL};

/// The equivalent of true for Objective-C's [`BOOL`][`super::BOOL`] type.
#[cfg(not(target_arch = "aarch64"))]
Expand Down
5 changes: 4 additions & 1 deletion objc_sys/src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
//! GNUStep: `eh_personality.c`, which is a bit brittle to rely on, but I
//! think it's fine...
use core::ffi::c_void;
#[cfg(any(apple, gnustep))]
use std::os::raw::c_int;

use crate::{objc_class, objc_object};
#[cfg(apple)]
use crate::objc_class;
use crate::objc_object;

/// Remember that this is non-null!
#[cfg(apple)]
Expand Down
6 changes: 4 additions & 2 deletions objc_sys/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
//! Most of these are `cfg`-gated, these configs are semver-stable.
//!
//! TODO: Some of these are only supported on _some_ GNUStep targets!
use super::{objc_class, objc_object};
use crate::{objc_class, objc_object};
#[cfg(gnustep)]
use crate::{objc_selector, IMP};

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

Expand Down
8 changes: 6 additions & 2 deletions objc_sys/src/various.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
use core::ffi::c_void;
use std::os::raw::{c_char, c_int, c_uint};
use std::os::raw::c_char;
#[cfg(apple)]
use std::os::raw::{c_int, c_uint};

use crate::{objc_AssociationPolicy, objc_class, objc_object, OpaqueData, BOOL};
#[cfg(apple)]
use crate::objc_class;
use crate::{objc_AssociationPolicy, objc_object, OpaqueData, BOOL};

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

0 comments on commit 216b1b4

Please sign in to comment.