Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make marshaller types public to ensure non-blittable structs can be properly marshalled. #976

Merged
merged 2 commits into from
Sep 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/cswinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6074,7 +6074,7 @@ public override int GetHashCode() => %;
}) != marshalers.end();

w.write(R"(
internal struct Marshaler
public struct Marshaler
{
%public % __abi;
)",
Expand All @@ -6101,7 +6101,7 @@ internal struct Marshaler
w.write("}\n");

w.write(R"(
internal static Marshaler CreateMarshaler(% arg)
public static Marshaler CreateMarshaler(% arg)
{
var m = new Marshaler();)",
projected_type);
Expand Down Expand Up @@ -6171,7 +6171,7 @@ return default;
w.write("}\n");

w.write(R"(
internal static % GetAbi(Marshaler m) => m.__abi;
public static % GetAbi(Marshaler m) => m.__abi;
)",
abi_type);

Expand Down Expand Up @@ -6262,7 +6262,7 @@ return new %()
});

w.write(R"(
internal static unsafe void CopyAbi(Marshaler arg, IntPtr dest) =>
public static unsafe void CopyAbi(Marshaler arg, IntPtr dest) =>
*(%*)dest.ToPointer() = GetAbi(arg);
)",
abi_type);
Expand All @@ -6275,7 +6275,7 @@ public static unsafe void CopyManaged(% arg, IntPtr dest) =>
abi_type);

w.write(R"(
internal static void DisposeMarshaler(Marshaler m) %
public static void DisposeMarshaler(Marshaler m) %
)",
have_disposers ? "=> m.Dispose();" : "{}");

Expand Down