Skip to content

Commit

Permalink
continue on Apple Watch support
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 12, 2024
1 parent 64e012e commit 8cca4e9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cidre/pomace/av/av.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion cidre/pomace/pomace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */,
Expand Down
9 changes: 9 additions & 0 deletions cidre/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ impl<T> DlSym<T> {

unsafe impl<T> Sync for DlSym<T> {}

#[cfg(feature = "ns")]
use crate::ns;

#[inline]
#[cfg(feature = "ns")]
pub fn macos_available(_ver: &str) -> bool {
#[cfg(not(target_os = "macos"))]
return false;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions cidre/src/cf/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -473,7 +473,7 @@ extern "C-unwind" {

#[repr(C)]
pub struct ConstStr {
pub isa: &'static crate::objc::Class<ns::Id>,
pub isa: &'static std::ffi::c_void,
pub info: u32,
pub ptr: *const i8,
pub len: usize,
Expand Down

0 comments on commit 8cca4e9

Please sign in to comment.