Skip to content

Commit

Permalink
Project contract names so they can be passed to IsApiContractPresent (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing authored Aug 10, 2022
1 parent f65801e commit 36567e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cppwinrt/file_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ namespace cppwinrt
w.write_each<write_forward>(members.classes);
w.write_each<write_forward>(members.structs);
w.write_each<write_forward>(members.delegates);
w.write_each<write_forward>(members.contracts);
}
{
auto wrap_impl = wrap_impl_namespace(w);
Expand All @@ -89,11 +90,13 @@ namespace cppwinrt
// Class names are always required for activation.
// Class, enum, and struct names are required for producing GUIDs for generic types.
// Interface and delegates names are required for Xaml compatibility.
// Contract names are used by IsApiContractPresent.
w.write_each<write_name>(members.classes);
w.write_each<write_name>(members.enums);
w.write_each<write_name>(members.structs);
w.write_each<write_name>(members.interfaces);
w.write_each<write_name>(members.delegates);
w.write_each<write_name>(members.contracts);

w.write_each<write_guid>(members.interfaces);
w.write_each<write_guid>(members.delegates);
Expand Down
1 change: 1 addition & 0 deletions test/test/names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ TEST_CASE("names")
check_terminated(name_of<IInspectable>());
check_terminated(name_of<EventHandler<guid>>());
check_terminated(name_of<TypedEventHandler<guid, Point>>());
check_terminated(name_of<Windows::Foundation::UniversalApiContract>());
}

0 comments on commit 36567e6

Please sign in to comment.