Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement runtime availability checking #661

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/objc2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Allow using `Into` to convert to retained objects.
* Make `Retained::into_super` an inherent method instead of an associated
method. This means that you can now use it as `.into_super()`.
* Added the `available!()` macro for determining whether code is running on
a given operating system.

### Changed
* **BREAKING**: Changed how you specify a class to only be available on the
Expand Down
3 changes: 3 additions & 0 deletions crates/objc2/src/__macro_helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub use core::borrow::Borrow;
pub use core::cell::UnsafeCell;
pub use core::convert::AsRef;
pub use core::default::Default;
pub use core::marker::{PhantomData, Sized};
pub use core::mem::{size_of, ManuallyDrop, MaybeUninit};
pub use core::ops::Deref;
Expand All @@ -21,6 +22,7 @@ mod method_family;
mod module_info;
mod msg_send;
mod msg_send_retained;
mod os_version;
mod writeback;

pub use self::cache::{CachedClass, CachedSel};
Expand All @@ -38,6 +40,7 @@ pub use self::method_family::{
pub use self::module_info::ModuleInfo;
pub use self::msg_send::MsgSend;
pub use self::msg_send_retained::{MaybeUnwrap, MsgSendId, MsgSendSuperId};
pub use self::os_version::{is_available, AvailableVersion, OSVersion};

/// Disallow using this passed in value in const and statics for forwards
/// compatibility (this function is not a `const` function).
Expand Down
Loading
Loading