Skip to content

Commit 099df9e

Browse files
authored
Merge pull request #72 from Ted-Jin-Lab/development
2 parents 4794375 + 426dd45 commit 099df9e

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<Version>2025.11.24.2</Version>
4+
<Version>2025.11.24.3</Version>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<LangVersion>preview</LangVersion>

Tests/TedToolkit.CppInteropGen.Cpp/FunctionPointer2_C.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
typedef int FunctionPointer2;
66
typedef int AbsorbedDose;
77

8-
CSHARP_WRAPPER(FunctionPointer2_Create_0(FunctionPointer2*& handle), {
8+
CSHARP_WRAPPER(FunctionPointer2_Create_0(const AbsorbedDose x, const AbsorbedDose y, const AbsorbedDose z,FunctionPointer2*& handle), {
99
handle = new FunctionPointer2();
1010
})
1111

src/analyzers/TedToolkit.CppInteropGen.SourceGenerator/CppClassGenerator.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ public IEnumerable<MemberDeclarationSyntax> Generate()
214214
.._parameters.Take(_parameters.Count - 1).Select(p => p.GenerateParameter())
215215
]))
216216
.WithBody(Block(
217-
GetFunctionPointer(_parameters.Select(p => FunctionPointerParameter(p.InnerType))),
217+
GetFunctionPointer(_parameters.Select((p, i) =>
218+
FunctionPointerParameter(i == _parameters.Count-1 ? p.InnerType : p.InnerCppType))),
218219
FixedStatement(VariableDeclaration(PointerType(PointerType(IdentifierName("Data"))))
219220
.WithVariables([
220221
VariableDeclarator(Identifier("ptr"))
@@ -240,7 +241,8 @@ public IEnumerable<MemberDeclarationSyntax> Generate()
240241
.WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.OverrideKeyword)))
241242
.WithAttributeLists([GeneratedCodeAttribute(typeof(CMethodGenerator))])
242243
.WithBody(Block(
243-
GetFunctionPointer(_parameters.Select(p => FunctionPointerParameter(p.InnerType))),
244+
GetFunctionPointer(_parameters.Select((p, i) =>
245+
FunctionPointerParameter(i == 0 ? p.InnerType : p.InnerCppType))),
244246
ExpressionStatement(InvocationExpression(IdentifierName("ThrowIfError"))
245247
.WithArgumentList(ArgumentList([
246248
Argument(InvocationExpression(IdentifierName("__method"))

0 commit comments

Comments
 (0)