Skip to content

Commit

Permalink
hopefully the last one (#137)
Browse files Browse the repository at this point in the history
* hopefully the last one

* add different check for GUID type
  • Loading branch information
stevenbrix authored Jan 19, 2024
1 parent 97da022 commit cbe0051
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions swiftwinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,6 @@ bind<write_abi_args>(function));

auto impl_names = w.push_impl_names(true);

auto c_name = is_struct(*generic_param) ?
generic_param->mangled_name() :
generic_param->cpp_abi_name();

w.write(R"(internal enum %: ReferenceBridge {
typealias CABI = %
typealias SwiftProjection = %
Expand All @@ -527,7 +523,7 @@ bind<write_abi_args>(function));
get_full_swift_type_name(w, generic_param),
w.support,
type.mangled_name(),
c_name,
bind<write_type>(*generic_param, write_type_params::c_abi),
bind<write_default_init_assignment>(*generic_param, projection_layer::c_abi),
bind<write_consume_type>(generic_param, "result", true),
type.mangled_name());
Expand Down
2 changes: 1 addition & 1 deletion swiftwinrt/code_writers/type_writers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static void write_c_abi_type(writer& w, metadata_type const& type)
}
else if (auto systype = dynamic_cast<const system_type*>(&type))
{
if (systype->cpp_abi_name() == "GUID")
if (systype->category() == param_category::guid_type)
{
w.write("%.GUID", w.support);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7121,7 +7121,7 @@ internal enum __x_ABI_C__FIReference_1_GUIDBridge: ReferenceBridge {

static func from(abi: ComPtr<CABI>?) -> SwiftProjection? {
guard let val = abi else { return nil }
var result: GUID = .init()
var result: test_component.GUID = .init()
try! CHECKED(val.get().pointee.lpVtbl.pointee.get_Value(val.get(), &result))
return .init(from: result)
}
Expand Down Expand Up @@ -7237,7 +7237,7 @@ internal enum __x_ABI_C__FIReference_1___x_ABI_Ctest__zcomponent__CSignedBridge:

static func from(abi: ComPtr<CABI>?) -> SwiftProjection? {
guard let val = abi else { return nil }
var result: Signed = .init(0)
var result: __x_ABI_Ctest__component_CSigned = .init(0)
try! CHECKED(val.get().pointee.lpVtbl.pointee.get_Value(val.get(), &result))
return result
}
Expand Down

0 comments on commit cbe0051

Please sign in to comment.