Skip to content

Commit

Permalink
this is special only for header files
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbrix committed Aug 16, 2023
1 parent d42fee1 commit 11cf993
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
8 changes: 7 additions & 1 deletion swiftwinrt/abi_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,15 @@ namespace swiftwinrt
// Don't write "built-in types" since these are defined in other header files
// These aren't completely removed from metadata because we need to generate them
// on the swift side
static std::set<std::string_view> removed_types = {
"Windows.Foundation.Collections.CollectionChange",
"Windows.Foundation.Collections.IVectorChangedEventArgs",
"Windows.Foundation.IAsyncInfo",
"Windows.Foundation.AsyncStatus"
};
static bool should_write(metadata_type const& type)
{
return !use_sdk_c_header_definition(type);
return !removed_types.contains(type.swift_full_name());
}

static void write_includes(writer& w, type_cache const& types, std::string_view fileName)
Expand Down
11 changes: 0 additions & 11 deletions swiftwinrt/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -907,15 +907,4 @@ namespace swiftwinrt

return true;
}

inline bool use_sdk_c_header_definition(metadata_type const& type)
{
static std::set<std::string_view> removed_types = {
"Windows.Foundation.Collections.CollectionChange",
"Windows.Foundation.Collections.IVectorChangedEventArgs",
"Windows.Foundation.IAsyncInfo",
"Windows.Foundation.AsyncStatus"
};
return removed_types.contains(type.swift_full_name());
}
}

0 comments on commit 11cf993

Please sign in to comment.