Skip to content

Commit 96973ad

Browse files
guuswkvark
authored andcommitted
Fix visionos cfgs
1 parent 02b4375 commit 96973ad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/device.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ pub struct MTLAccelerationStructureSizes {
14611461
#[cfg_attr(feature = "link", link(name = "Metal", kind = "framework"))]
14621462
extern "C" {
14631463
fn MTLCreateSystemDefaultDevice() -> *mut MTLDevice;
1464-
#[cfg(not(target_os = "ios"))]
1464+
#[cfg(not(any(target_os = "ios", target_os = "visionos")))]
14651465
fn MTLCopyAllDevices() -> *mut Object; //TODO: Array
14661466
}
14671467

@@ -1475,11 +1475,11 @@ type dispatch_block_t = *const Block<(), ()>;
14751475
const DISPATCH_DATA_DESTRUCTOR_DEFAULT: dispatch_block_t = ptr::null();
14761476

14771477
#[cfg_attr(
1478-
all(feature = "link", any(target_os = "macos", target_os = "ios")),
1478+
all(feature = "link", any(target_os = "macos", target_os = "ios", target_os = "visionos")),
14791479
link(name = "System", kind = "dylib")
14801480
)]
14811481
#[cfg_attr(
1482-
all(feature = "link", not(any(target_os = "macos", target_os = "ios"))),
1482+
all(feature = "link", not(any(target_os = "macos", target_os = "ios", target_os = "visionos"))),
14831483
link(name = "dispatch", kind = "dylib")
14841484
)]
14851485
#[allow(improper_ctypes)]
@@ -1520,11 +1520,11 @@ impl Device {
15201520
}
15211521

15221522
pub fn all() -> Vec<Self> {
1523-
#[cfg(target_os = "ios")]
1523+
#[cfg(any(target_os = "ios", target_os = "visionos"))]
15241524
{
15251525
Self::system_default().into_iter().collect()
15261526
}
1527-
#[cfg(not(target_os = "ios"))]
1527+
#[cfg(not(any(target_os = "ios", target_os = "visionos")))]
15281528
unsafe {
15291529
let array = MTLCopyAllDevices();
15301530
let count: NSUInteger = msg_send![array, count];

0 commit comments

Comments
 (0)