From b4726fd48ea2bc51c3d97c504b9af565344973b4 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sat, 27 Jun 2020 13:02:41 +0300 Subject: [PATCH] Don't add ABI-specific parameters when wrapping C Fixes https://github.com/mono/CppSharp/issues/1008. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpGenerator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpGenerator.cs b/src/Generator/Generators/CSharp/CSharpGenerator.cs index 212e0cee..5d6da474 100644 --- a/src/Generator/Generators/CSharp/CSharpGenerator.cs +++ b/src/Generator/Generators/CSharp/CSharpGenerator.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using CppSharp.AST; using CppSharp.Passes; +using CppSharp.Parser; namespace CppSharp.Generators.CSharp { @@ -36,7 +37,8 @@ namespace CppSharp.Generators.CSharp // CheckAbiParameters runs last because hidden structure parameters // should always occur first. - Context.TranslationUnitPasses.AddPass(new CheckAbiParameters()); + if (Context.ParserOptions.LanguageVersion > LanguageVersion.C99_GNU) + Context.TranslationUnitPasses.AddPass(new CheckAbiParameters()); return true; }