Skip to content

Commit 62ec4d4

Browse files
authored
Improve type name compatibility #451
1 parent 38382f8 commit 62ec4d4

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

cppwinrt/file_writers.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ namespace cppwinrt
8484

8585
// Class names are always required for activation.
8686
// Class, enum, and struct names are required for producing GUIDs for generic types.
87-
// Interface and delegates names are not required by WinRT.
87+
// Interface and delegates names are required for Xaml compatibility.
8888
w.write_each<write_name>(members.classes);
8989
w.write_each<write_name>(members.enums);
9090
w.write_each<write_name>(members.structs);
91-
write_lean_and_mean(w);
9291
w.write_each<write_name>(members.interfaces);
9392
w.write_each<write_name>(members.delegates);
94-
write_endif(w);
9593

9694
w.write_each<write_guid>(members.interfaces);
9795
w.write_each<write_guid>(members.delegates);

test/test/generic_type_names.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
//
2-
// Note that WINRT_LEAN_AND_MEAN is not defined for these tests.
3-
//
4-
51
// Windows.Foundation is intentionally *not* included here to ensure that stable names/guids
62
// are generated with only the xxx.0.h header. This ensures that indirect declarations produce
73
// stable identity values.
4+
#define WINRT_LEAN_AND_MEAN
85
#include "winrt/Windows.Storage.h"
96

107
#include "catch.hpp"

test/test/generic_types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ TEST_CASE("generic_types")
1111

1212
// Clang 9 doesn't think this is a constant expression.
1313
#ifndef __clang__
14-
REQUIRE_EQUAL_NAME(L"{96369f54-8eb6-48f0-abce-c1b211e627c3}", IStringable);
14+
REQUIRE_EQUAL_NAME(L"Windows.Foundation.IStringable", IStringable);
1515
#endif
1616
}

0 commit comments

Comments
 (0)