diff --git a/src/Bridge/Function.cs b/src/Bridge/Function.cs index 9579e6c9..e6d9b40e 100644 --- a/src/Bridge/Function.cs +++ b/src/Bridge/Function.cs @@ -69,6 +69,7 @@ namespace CppSharp public List Parameters { get; set; } public bool IsVariadic { get; set; } public bool IsInline { get; set; } + public bool IsPure { get; set; } public CallingConvention CallingConvention { get; set; } diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 6f4b1a04..afb32c6b 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -340,6 +340,9 @@ namespace CppSharp.Generators.CSharp if (ctor.IsCopyConstructor || ctor.IsMoveConstructor) continue; + if (ctor.IsPure) + continue; + NewLineIfNeeded(); GenerateInternalFunction(ctor); } @@ -355,6 +358,9 @@ namespace CppSharp.Generators.CSharp if (method.IsSynthetized) continue; + if (method.IsPure) + continue; + NewLineIfNeeded(); GenerateInternalFunction(method); } @@ -1218,6 +1224,12 @@ namespace CppSharp.Generators.CSharp public void GenerateFunctionCall(string functionName, List parameters, Function function) { + if (function.IsPure) + { + WriteLine("throw new System.NotImplementedException();"); + return; + } + var retType = function.ReturnType; var needsReturn = !retType.Type.IsPrimitiveType(PrimitiveType.Void); diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index 7539b977..2d71e91c 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -1256,6 +1256,7 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, CppSharp::Function^ F, F->IsVariadic = FD->isVariadic(); F->IsInline = FD->isInlined(); F->IsDependent = FD->isDependentContext(); + F->IsPure = FD->isPure(); auto AbiCC = GetAbiCallConv(CC, FD->isCXXInstanceMember(), FD->isVariadic()); F->CallingConvention = ConvertCallConv(AbiCC);