|
|
|
@ -68,7 +68,7 @@ namespace Cxxi.Generators.CSharp
@@ -68,7 +68,7 @@ namespace Cxxi.Generators.CSharp
|
|
|
|
|
{ |
|
|
|
|
var pointee = pointer.Pointee; |
|
|
|
|
|
|
|
|
|
if (pointee.IsPrimitiveType(PrimitiveType.Void, walkTypedefs: true)) |
|
|
|
|
if (pointee.Desugar().IsPrimitiveType(PrimitiveType.Void)) |
|
|
|
|
{ |
|
|
|
|
Context.Return.Write("new IntPtr({0})", Context.ReturnVarName); |
|
|
|
|
return true; |
|
|
|
@ -82,7 +82,7 @@ namespace Cxxi.Generators.CSharp
@@ -82,7 +82,7 @@ namespace Cxxi.Generators.CSharp
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PrimitiveType primitive; |
|
|
|
|
if (pointee.IsPrimitiveType(out primitive, walkTypedefs: true)) |
|
|
|
|
if (pointee.Desugar().IsPrimitiveType(out primitive)) |
|
|
|
|
{ |
|
|
|
|
Context.Return.Write("new IntPtr({0})", Context.ReturnVarName); |
|
|
|
|
return true; |
|
|
|
@ -273,11 +273,9 @@ namespace Cxxi.Generators.CSharp
@@ -273,11 +273,9 @@ namespace Cxxi.Generators.CSharp
|
|
|
|
|
{ |
|
|
|
|
var pointee = pointer.Pointee; |
|
|
|
|
|
|
|
|
|
var isVoidPtr = pointee.IsPrimitiveType(PrimitiveType.Void, |
|
|
|
|
walkTypedefs: true); |
|
|
|
|
var isVoidPtr = pointee.Desugar().IsPrimitiveType(PrimitiveType.Void); |
|
|
|
|
|
|
|
|
|
var isUInt8Ptr = pointee.IsPrimitiveType(PrimitiveType.UInt8, |
|
|
|
|
walkTypedefs: true); |
|
|
|
|
var isUInt8Ptr = pointee.Desugar().IsPrimitiveType(PrimitiveType.UInt8); |
|
|
|
|
|
|
|
|
|
if (isVoidPtr || isUInt8Ptr) |
|
|
|
|
{ |
|
|
|
@ -373,7 +371,7 @@ namespace Cxxi.Generators.CSharp
@@ -373,7 +371,7 @@ namespace Cxxi.Generators.CSharp
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PrimitiveType primitive; |
|
|
|
|
if (decl.Type.IsPrimitiveType(out primitive, walkTypedefs: true)) |
|
|
|
|
if (decl.Type.Desugar().IsPrimitiveType(out primitive)) |
|
|
|
|
{ |
|
|
|
|
Context.Return.Write("({0})", typedef.Declaration.Name); |
|
|
|
|
} |
|
|
|
|