Skip to content

Commit

Permalink
Update src/Core/Silk.NET.SilkTouch/NativeApiGenerator.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Sep 10, 2023
1 parent ce1aea2 commit ad0d9ff
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Core/Silk.NET.SilkTouch/NativeApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,22 +412,22 @@ INamedTypeSymbol pInvokeAttribute
var processedEntrypoints = new List<EntryPoint>();
bool any = false;
foreach (var (declaration, symbol, entryPoint, callingConvention) in from declaration in
from member in classDeclarations.SelectMany(x => x.Item1.Members.Select(x2 => (x2, x.Item2)))
where member.x2.IsKind(SyntaxKind.MethodDeclaration)
select ((MethodDeclarationSyntax) member.x2, member.Item2)
let symbol = declaration.Item2.GetDeclaredSymbol(declaration.Item1)
where symbol is not null
let attribute = ToNativeApiAttribute
(
symbol.GetAttributes()
.FirstOrDefault
(att => SymbolEqualityComparer.Default.Equals(att.AttributeClass, nativeApiAttributeSymbol))
)
where declaration.Item1.Modifiers.Any
(modifier => modifier.IsKind(SyntaxKind.PartialKeyword)) && symbol.PartialImplementationPart is null
let entryPoint = NativeApiAttribute.GetEntryPoint(attribute, classNativeApiAttribute, symbol.Name)
let callingConvention = NativeApiAttribute.GetCallingConvention(attribute, classNativeApiAttribute)
select (declaration, symbol, entryPoint, callingConvention))
from member in classDeclarations.SelectMany(x => x.Item1.Members.Select(x2 => (x2, x.Item2)))
where member.x2.IsKind(SyntaxKind.MethodDeclaration)
select ((MethodDeclarationSyntax) member.x2, member.Item2)
let symbol = declaration.Item2.GetDeclaredSymbol(declaration.Item1)
where symbol is not null
let attribute = ToNativeApiAttribute
(
symbol.GetAttributes()
.FirstOrDefault
(att => SymbolEqualityComparer.Default.Equals(att.AttributeClass, nativeApiAttributeSymbol))
)
where declaration.Item1.Modifiers.Any
(modifier => modifier.IsKind(SyntaxKind.PartialKeyword)) && symbol.PartialImplementationPart is null
let entryPoint = NativeApiAttribute.GetEntryPoint(attribute, classNativeApiAttribute, symbol.Name)
let callingConvention = NativeApiAttribute.GetCallingConvention(attribute, classNativeApiAttribute)
select (declaration, symbol, entryPoint, callingConvention))
{
any = true;

Expand Down

0 comments on commit ad0d9ff

Please sign in to comment.