Skip to content

Commit

Permalink
macros/class: Propagate cfg annotations to COM class methods
Browse files Browse the repository at this point in the history
We have a very peculiar workaround for DXC (pending upstream fix
[microsoft/DirectXShaderCompiler#3793]) that requires us to
conditionally provide function implementations for extra vtable
"spacers": https://github.com/Traverse-Research/hassle-rs/blob/f5a090c70bbcf66f3bafd3d549716a414e873838/src/wrapper.rs#L130-L139.
The spacers are conditionally defined in:
https://github.com/Traverse-Research/hassle-rs/blob/f5a090c70bbcf66f3bafd3d549716a414e873838/src/unknown.rs.

These need to be forwarded otherwise the initialization of these vtable
members will happen unconditionally even when they don't exist:
https://github.com/Traverse-Research/hassle-rs/actions/runs/1777800733

Fixes microsoft#166
[microsoft/DirectXShaderCompiler#3793]: microsoft/DirectXShaderCompiler#3793
  • Loading branch information
MarijnS95 committed Feb 1, 2022
1 parent 2a9c899 commit c8256cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions macros/support/src/class/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,9 @@ impl Interface {
}
};
let field_name = Ident::new(&crate::utils::snake_to_camel(&original_name.to_string()), proc_macro2::Span::call_site());
let attrs = &m.item.attrs;
quote! {
#(#attrs)*
#field_name: {
#method
#name
Expand Down

0 comments on commit c8256cb

Please sign in to comment.