Skip to content

Commit c59edc7

Browse files
committed
Address feedback
1 parent e044126 commit c59edc7

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6592,7 +6592,8 @@ private bool TryRemapOperatorName(ref string name, FunctionDecl functionDecl)
65926592
name = pointerIndirectionLevel switch {
65936593
0 => $"To{returnTypeName}",
65946594
1 => $"To{returnTypeName}Pointer",
6595-
_ => $"To{returnTypeName}Pointer{pointerIndirectionLevel}"
6595+
2 => $"To{returnTypeName}PointerPointer",
6596+
_ => $"To{returnTypeName}{string.Concat(Enumerable.Repeat("Pointer", pointerIndirectionLevel))}"
65966597
};
65976598
return true;
65986599
}

tests/ClangSharp.PInvokeGenerator.UnitTests/Base/CXXMethodDeclarationCSharpTest.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ protected override Task ConversionTestImpl()
9898
int value;
9999
int* pointer;
100100
int** pointer2;
101+
int*** pointer3;
101102
operator int()
102103
{
103104
return value;
@@ -110,6 +111,10 @@ operator int()
110111
{
111112
return pointer2;
112113
}
114+
operator int***()
115+
{
116+
return pointer3;
117+
}
113118
};
114119
";
115120

@@ -123,6 +128,8 @@ public unsafe partial struct MyStruct
123128
124129
public int** pointer2;
125130
131+
public int*** pointer3;
132+
126133
public int ToInt32()
127134
{
128135
return value;
@@ -133,10 +140,15 @@ public int ToInt32()
133140
return pointer;
134141
}
135142
136-
public int** ToInt32Pointer2()
143+
public int** ToInt32PointerPointer()
137144
{
138145
return pointer2;
139146
}
147+
148+
public int*** ToInt32PointerPointerPointer()
149+
{
150+
return pointer3;
151+
}
140152
}
141153
}
142154
";

0 commit comments

Comments
 (0)