From 11cf9935d1e4b06cdde579707ffb8553be5de383 Mon Sep 17 00:00:00 2001 From: Steve Kirbach Date: Wed, 16 Aug 2023 16:27:05 -0700 Subject: [PATCH] this is special only for header files --- swiftwinrt/abi_writer.h | 8 +++++++- swiftwinrt/helpers.h | 11 ----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/swiftwinrt/abi_writer.h b/swiftwinrt/abi_writer.h index 9ff3e9f9..cd174166 100644 --- a/swiftwinrt/abi_writer.h +++ b/swiftwinrt/abi_writer.h @@ -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 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) diff --git a/swiftwinrt/helpers.h b/swiftwinrt/helpers.h index a7f75b1d..09aba315 100644 --- a/swiftwinrt/helpers.h +++ b/swiftwinrt/helpers.h @@ -907,15 +907,4 @@ namespace swiftwinrt return true; } - - inline bool use_sdk_c_header_definition(metadata_type const& type) - { - static std::set removed_types = { - "Windows.Foundation.Collections.CollectionChange", - "Windows.Foundation.Collections.IVectorChangedEventArgs", - "Windows.Foundation.IAsyncInfo", - "Windows.Foundation.AsyncStatus" - }; - return removed_types.contains(type.swift_full_name()); - } }