Skip to content

Commit

Permalink
gsk: Guard Broadway/Vulkan RendererClass
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Aug 27, 2023
1 parent aec5952 commit 31930e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gsk4/sys/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ cfg_condition = "feature = \"broadway\""
[[object.function]]
pattern = "(new|get_type)"
cfg_condition = "feature = \"broadway\""


[[object]]
name = "Gsk.BroadwayRendererClass"
status = "generate"
cfg_condition = "feature = \"broadway\""

[[object]]
name = "Gsk.PathMeasure"
status = "generate"
Expand All @@ -38,3 +43,8 @@ cfg_condition = "feature = \"vulkan\""
[[object.function]]
pattern = "(new|get_type)"
cfg_condition = "feature = \"vulkan\""

[[object]]
name = "Gsk.VulkanRendererClass"
status = "generate"
cfg_condition = "feature = \"vulkan\""
8 changes: 8 additions & 0 deletions gsk4/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,16 @@ pub type GskPathForeachFunc = Option<
>;

// Records
#[cfg(feature = "broadway")]
#[cfg_attr(docsrs, doc(cfg(feature = "broadway")))]
#[repr(C)]
pub struct _GskBroadwayRendererClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

#[cfg(feature = "broadway")]
#[cfg_attr(docsrs, doc(cfg(feature = "broadway")))]
pub type GskBroadwayRendererClass = *mut _GskBroadwayRendererClass;

#[repr(C)]
Expand Down Expand Up @@ -393,12 +397,16 @@ impl ::std::fmt::Debug for GskTransform {
}
}

#[cfg(feature = "vulkan")]
#[cfg_attr(docsrs, doc(cfg(feature = "vulkan")))]
#[repr(C)]
pub struct _GskVulkanRendererClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

#[cfg(feature = "vulkan")]
#[cfg_attr(docsrs, doc(cfg(feature = "vulkan")))]
pub type GskVulkanRendererClass = *mut _GskVulkanRendererClass;

// Classes
Expand Down

0 comments on commit 31930e2

Please sign in to comment.