From 7ab85a4c68ac032cdda1c56dc79767a75e1642ef Mon Sep 17 00:00:00 2001 From: Clinton Ingram Date: Wed, 20 Apr 2022 21:18:21 -0700 Subject: [PATCH] fix function access specifiers --- .../CSharp/CSharpOutputBuilder.VisitDecl.cs | 2 +- .../PInvokeGenerator.VisitDecl.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs index 19722075..2bc06e95 100644 --- a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs +++ b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs @@ -445,7 +445,7 @@ public void BeginFunctionOrDelegate(in FunctionOrDelegateDesc desc, ref bool isM } else { - WriteIndented(GetAccessSpecifierString(desc.AccessSpecifier, isNested: false)); + WriteIndented(GetAccessSpecifierString(desc.AccessSpecifier, isNested: true)); Write(' '); } diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs index 12009575..0dfe68fb 100644 --- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs +++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs @@ -491,7 +491,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl) return; } - var accessSppecifier = GetAccessSpecifier(functionDecl); + var accessSpecifier = GetAccessSpecifier(functionDecl); var body = functionDecl.Body; var hasBody = body is not null; @@ -530,7 +530,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl) var needsReturnFixup = isCxxMethodDecl && NeedsReturnFixup(cxxMethodDecl); var desc = new FunctionOrDelegateDesc { - AccessSpecifier = accessSppecifier, + AccessSpecifier = accessSpecifier, NativeTypeName = nativeTypeName, EscapedName = escapedName, ParentName = parentName, @@ -3677,7 +3677,7 @@ private bool IsPrimitiveValue(Type type) { return IsPrimitiveValue(autoType.CanonicalType); } - else if (type is BuiltinType builtinType) + else if (type is BuiltinType) { switch (type.Kind) {