diff --git a/src/com.rs b/src/com.rs index 10edee7..f0eca92 100644 --- a/src/com.rs +++ b/src/com.rs @@ -171,13 +171,13 @@ impl Hash for ComPtr { /// - the unwrap function (`&self -> ComPtr` panicing on failure to cast) /// /// ```rust -/// # pub use d3d12::weak_com_inheritance_chain; +/// # pub use d3d12::com_inheritance_chain; /// # mod actual { /// # pub struct ComObject; impl winapi::Interface for ComObject { fn uuidof() -> winapi::shared::guiddef::GUID { todo!() } } /// # pub struct ComObject1; impl winapi::Interface for ComObject1 { fn uuidof() -> winapi::shared::guiddef::GUID { todo!() } } /// # pub struct ComObject2; impl winapi::Interface for ComObject2 { fn uuidof() -> winapi::shared::guiddef::GUID { todo!() } } /// # } -/// weak_com_inheritance_chain! { +/// com_inheritance_chain! { /// pub enum MyComObject { /// MyComObject(actual::ComObject), from_my_com_object, as_my_com_object, my_com_object; // First variant doesn't use "unwrap" as it can never fail /// MyComObject1(actual::ComObject1), from_my_com_object1, as_my_com_object1, unwrap_my_com_object1; @@ -186,7 +186,7 @@ impl Hash for ComPtr { /// } /// ``` #[macro_export] -macro_rules! weak_com_inheritance_chain { +macro_rules! com_inheritance_chain { // We first match a human readable enum style, before going into the recursive section. // // Internal calls to the macro have either the prefix @@ -207,7 +207,7 @@ macro_rules! weak_com_inheritance_chain { ),+ } impl $name { - $crate::weak_com_inheritance_chain! { + $crate::com_inheritance_chain! { @recursion_logic, $vis, ; @@ -235,7 +235,7 @@ macro_rules! weak_com_inheritance_chain { $($next_variant:ident($next_type:ty), $next_from_name:ident, $next_as_name:ident, $next_unwrap_name:ident);* ) => { // Actually generate the members for this variant. Needs the previous and future variant names. - $crate::weak_com_inheritance_chain! { + $crate::com_inheritance_chain! { @render_members, $vis, $this_from_name, $this_as_name, $this_unwrap_name; @@ -245,7 +245,7 @@ macro_rules! weak_com_inheritance_chain { } // Recurse on ourselves. If there is no future variants left, we'll hit the base case as the final expansion returns no tokens. - $crate::weak_com_inheritance_chain! { + $crate::com_inheritance_chain! { @recursion_logic, $vis, $($prev_variant),* , $this_variant; diff --git a/src/dxgi.rs b/src/dxgi.rs index 7a67299..ca5db4e 100644 --- a/src/dxgi.rs +++ b/src/dxgi.rs @@ -49,7 +49,7 @@ pub type Adapter1 = ComPtr; pub type Adapter2 = ComPtr; pub type Adapter3 = ComPtr; pub type Adapter4 = ComPtr; -crate::weak_com_inheritance_chain! { +crate::com_inheritance_chain! { #[derive(Debug, Clone, PartialEq, Hash)] pub enum DxgiAdapter { Adapter1(dxgi::IDXGIAdapter1), from_adapter1, as_adapter1, adapter1; @@ -65,7 +65,7 @@ pub type Factory3 = ComPtr; pub type Factory4 = ComPtr; pub type Factory5 = ComPtr; pub type Factory6 = ComPtr; -crate::weak_com_inheritance_chain! { +crate::com_inheritance_chain! { #[derive(Debug, Clone, PartialEq, Hash)] pub enum DxgiFactory { Factory1(dxgi::IDXGIFactory1), from_factory1, as_factory1, factory1; @@ -83,7 +83,7 @@ pub type SwapChain = ComPtr; pub type SwapChain1 = ComPtr; pub type SwapChain2 = ComPtr; pub type SwapChain3 = ComPtr; -crate::weak_com_inheritance_chain! { +crate::com_inheritance_chain! { #[derive(Debug, Clone, PartialEq, Hash)] pub enum DxgiSwapchain { SwapChain(dxgi::IDXGISwapChain), from_swap_chain, as_swap_chain, swap_chain;