File tree 2 files changed +20
-3
lines changed
Generator/Generators/CSharp
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -561,9 +561,13 @@ public TypePrinterResult VisitTemplateArgument(TemplateArgument a)
561
561
if ( a . Type . Type == null )
562
562
return a . Integral . ToString ( CultureInfo . InvariantCulture ) ;
563
563
var type = a . Type . Type . Desugar ( ) ;
564
- return type . IsPointerToPrimitiveType ( ) && ! type . IsConstCharString ( ) ?
565
- IntPtrType : type . IsPrimitiveType ( PrimitiveType . Void ) ? "object" :
566
- type . Visit ( this ) . Type ;
564
+ PrimitiveType pointee ;
565
+ if ( type . IsPointerToPrimitiveType ( out pointee ) && ! type . IsConstCharString ( ) )
566
+ {
567
+ return $@ "CppSharp.Runtime.Pointer<{ ( pointee == PrimitiveType . Void ? IntPtrType :
568
+ VisitPrimitiveType ( pointee , new TypeQualifiers ( ) ) . Type ) } >" ;
569
+ }
570
+ return ( type . IsPrimitiveType ( PrimitiveType . Void ) ) ? "object" : type . Visit ( this ) . Type ;
567
571
}
568
572
569
573
public override TypePrinterResult VisitParameterDecl ( Parameter parameter )
Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ namespace CppSharp . Runtime
4
+ {
5
+ public class Pointer < T >
6
+ {
7
+ public Pointer ( IntPtr ptr ) => this . ptr = ptr ;
8
+
9
+ public static implicit operator IntPtr ( Pointer < T > pointer ) => pointer . ptr ;
10
+
11
+ private readonly IntPtr ptr ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments