Skip to content

Commit

Permalink
feat: let delegate_noop can handle constGeneric
Browse files Browse the repository at this point in the history
the macro of delegate_noop cannot handle like
struct A<const X: unsize>, such kind of struct, so I want to fix it
  • Loading branch information
Decodetalkers committed Nov 29, 2023
1 parent fdd88c4 commit bb9f5ec
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions wayland-client/src/event_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,22 @@ macro_rules! delegate_noop {
}
};

// delegate_noop!(@<const X: unsize> ExampleApp<X>: wl_subcompositor::WlSubcompositor);
($(@< $( const $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)? $dispatch_from: ty : $interface: ty) => {
impl$(< $(const $lt $( : $clt $(+ $dlt )* )? ),+ >)? $crate::Dispatch<$interface, ()> for $dispatch_from {
fn event(
_: &mut Self,
_: &$interface,
_: <$interface as $crate::Proxy>::Event,
_: &(),
_: &$crate::Connection,
_: &$crate::QueueHandle<Self>,
) {
unreachable!();
}
}
};

($(@< $( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)? $dispatch_from: ty : ignore $interface: ty) => {
impl$(< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $crate::Dispatch<$interface, ()> for $dispatch_from {
fn event(
Expand All @@ -864,4 +880,19 @@ macro_rules! delegate_noop {
}
}
};

// delegate_noop!(@<const X: unsize> ExampleApp<X>: ignore wl_subcompositor::WlSubcompositor);
($(@< $( const $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)? $dispatch_from: ty : ignore $interface: ty) => {
impl$(< $( const $lt $( : $clt $(+ $dlt )* )? ),+ >)? $crate::Dispatch<$interface, ()> for $dispatch_from {
fn event(
_: &mut Self,
_: &$interface,
_: <$interface as $crate::Proxy>::Event,
_: &(),
_: &$crate::Connection,
_: &$crate::QueueHandle<Self>,
) {
}
}
};
}

0 comments on commit bb9f5ec

Please sign in to comment.