Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 6 additions & 4 deletions ClosedGenericInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ private string GetSourceText()
}
var method = InterceptsMethod;
var typeParameters = Constants.InterceptorTypeParameters[method.ContainingInterface.Arity];
typeParameters = typeParameters.Length != 0 ?
$"<{typeParameters}>" :
typeParameters;
typeParameters = method.Arity != 0 ?
$"<{typeParameters}, XMarshaller>" :
typeParameters.Length != 0 ?
$"<{typeParameters}>" :
typeParameters;
_ = sb.Append
(
$@"[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -60,7 +62,7 @@ public static {method.ContainingInterface.FullName} {method.Name}{typeParameters
){Constants.InterceptorAntiConstraints[method.ContainingInterface.Arity]}
{{"
);
if (ImplementationClass.Marshalling.StaticCallingConvention is not null)
if (ImplementationClass.MarshalInfo.StaticCallingConvention is not null)
{
_ = sb.Append
(
Expand Down
2 changes: 1 addition & 1 deletion Constants.Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal static class Actions
$"{RootNamespace}.INativeAction`13",
$"{RootNamespace}.INativeAction`14",
$"{RootNamespace}.INativeAction`15",
$"{RootNamespace}.INativeAction`16",
$"{RootNamespace}.INativeAction`16"
];

public static readonly string[] QualifiedTypeParameters = Constants.QualifiedTypeParameters;
Expand Down
2 changes: 1 addition & 1 deletion Constants.Funcs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ .. Constants.AntiConstraints.Skip(1)
$"{RootNamespace}.INativeFunc`14",
$"{RootNamespace}.INativeFunc`15",
$"{RootNamespace}.INativeFunc`16",
$"{RootNamespace}.INativeFunc`17",
$"{RootNamespace}.INativeFunc`17"
];

public static readonly string[] QualifiedTypeParameters =
Expand Down
8 changes: 6 additions & 2 deletions Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ internal static partial class Constants

public static readonly string[] InterceptorAntiConstraints =
[
.. AntiConstraints.Select(static x => x.Replace('T', 'X')),
$"{AntiConstraint_T1_T16.Replace('T', 'X')}{NewLineIndent2}where X17 : allows ref struct"
.. AntiConstraints.Select(static x => x.Replace(" where T", " where X").Replace('T', 'X')),
$"{AntiConstraint_T1_T16.Replace(" where T", " where X")
.Replace('T', 'X')}{NewLineIndent2}where X17 : allows ref struct"
];

public static readonly string[] Arguments =
Expand Down Expand Up @@ -111,6 +112,9 @@ .. AntiConstraints.Select(static x => x.Replace('T', 'X')),
public const string RootNamespace = "Monkeymoto.NativeGenericDelegates";
public const string DeclarationsSourceFileName = RootNamespace + ".Declarations.g.cs";

public const string IMarshallerInterfaceName = "IMarshaller";
public const string IMarshallerMetadataName = $"{RootNamespace}.{IMarshallerInterfaceName}`1";

/// <summary>
/// Returns the total number of interfaces per category (Action or Func).
/// </summary>
Expand Down
322 changes: 0 additions & 322 deletions DelegateMarshalling.Parser.cs

This file was deleted.

Loading