diff --git a/cidre/pomace/av/av.h b/cidre/pomace/av/av.h index 80b65596..f69a30ca 100644 --- a/cidre/pomace/av/av.h +++ b/cidre/pomace/av/av.h @@ -191,7 +191,7 @@ static void av_initializer(void) AV_CAPTURE_SLIDER = NSClassFromString(@"AVCaptureSlider"); AV_CAPTURE_INDEX_PICKER = NSClassFromString(@"AVCaptureIndexPicker"); - AV_ASSET_IMAGE_GENERATOR = [AVAssetImageGenerator class]; + AV_ASSET_IMAGE_GENERATOR = NSClassFromString(@"AVAssetImageGenerator"); AV_EXTERNAL_STORAGE_DEVICE = NSClassFromString(@"AVExternalStorageDevice"); AV_EXTERNAL_STORAGE_DEVICE_DISCOVERY_SESSION = NSClassFromString(@" AVExternalStorageDeviceDiscoverySession"); diff --git a/cidre/pomace/pomace.xcodeproj/project.pbxproj b/cidre/pomace/pomace.xcodeproj/project.pbxproj index 630263c4..a80acc47 100644 --- a/cidre/pomace/pomace.xcodeproj/project.pbxproj +++ b/cidre/pomace/pomace.xcodeproj/project.pbxproj @@ -1417,13 +1417,13 @@ projectDirPath = ""; projectRoot = ""; targets = ( + D21A0FF0287738ED00AB7EF8 /* ns */, D2FBEBF627CB653200FD974A /* mtl */, D2520CFB280BFC4A00FD6562 /* sc */, D2FA4ADA2820227B001E2A51 /* av */, D2A52938283A1F5800E7B4C6 /* ca */, D2A52945283A1F6A00E7B4C6 /* ci */, D20656AC283DCA2200048B17 /* ui */, - D21A0FF0287738ED00AB7EF8 /* ns */, D264D29D28F7E7CF002B1B14 /* vn */, D2DC5D21295870DB007E2B9D /* sn */, D2DC5D33295B5064007E2B9D /* mps */, diff --git a/cidre/src/api.rs b/cidre/src/api.rs index 976da658..3d5bb008 100644 --- a/cidre/src/api.rs +++ b/cidre/src/api.rs @@ -89,9 +89,11 @@ impl DlSym { unsafe impl Sync for DlSym {} +#[cfg(feature = "ns")] use crate::ns; #[inline] +#[cfg(feature = "ns")] pub fn macos_available(_ver: &str) -> bool { #[cfg(not(target_os = "macos"))] return false; @@ -100,6 +102,7 @@ pub fn macos_available(_ver: &str) -> bool { } #[inline] +#[cfg(feature = "ns")] pub fn ios_available(_ver: &str) -> bool { #[cfg(not(target_os = "ios"))] return false; @@ -108,6 +111,7 @@ pub fn ios_available(_ver: &str) -> bool { } #[inline] +#[cfg(feature = "ns")] pub fn tvos_available(_ver: &str) -> bool { #[cfg(not(target_os = "tvos"))] return false; @@ -116,6 +120,7 @@ pub fn tvos_available(_ver: &str) -> bool { } #[inline] +#[cfg(feature = "ns")] pub fn watchos_available(_ver: &str) -> bool { #[cfg(not(target_os = "watchos"))] return false; @@ -124,6 +129,7 @@ pub fn watchos_available(_ver: &str) -> bool { } #[inline] +#[cfg(feature = "ns")] pub fn visionos_available(_ver: &str) -> bool { #[cfg(not(target_os = "visionos"))] return false; @@ -132,6 +138,7 @@ pub fn visionos_available(_ver: &str) -> bool { } #[inline] +#[cfg(feature = "ns")] pub fn maccatalyst_available(_ver: &str) -> bool { #[cfg(not(all(target_os = "ios", target_abi = "macabi")))] return false; @@ -215,7 +222,9 @@ macro_rules! version { $( || $crate::api::version!(visionos = $visionos_ver))? }; } +#[cfg(feature = "ns")] pub use cidre_macros::api_available as available; +#[cfg(feature = "ns")] pub use cidre_macros::api_weak as weak; pub use version; diff --git a/cidre/src/cf/string.rs b/cidre/src/cf/string.rs index 22af50bd..494660fd 100644 --- a/cidre/src/cf/string.rs +++ b/cidre/src/cf/string.rs @@ -310,7 +310,7 @@ macro_rules! cfstr { ($f:literal) => {{ #[link(name = "CoreFoundation", kind = "framework")] extern "C" { - static __CFConstantStringClassReference: $crate::objc::Class<$crate::ns::Id>; + static __CFConstantStringClassReference: std::ffi::c_void; } // #[link_section = "__TEXT,__cstring,cstring_literals"] const VALUE: &std::ffi::CStr = $f; @@ -473,7 +473,7 @@ extern "C-unwind" { #[repr(C)] pub struct ConstStr { - pub isa: &'static crate::objc::Class, + pub isa: &'static std::ffi::c_void, pub info: u32, pub ptr: *const i8, pub len: usize,