From f2c86a509a34e8e16054f5cda09ef706d5f0eb1d Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 20 Feb 2013 14:27:39 +0000 Subject: [PATCH] Fixed the 64-bit primitive support in CLI type printing. --- src/Generator/Generators/CLI/CLITypePrinter.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Generator/Generators/CLI/CLITypePrinter.cs b/src/Generator/Generators/CLI/CLITypePrinter.cs index 4ac715b7..115b4c2c 100644 --- a/src/Generator/Generators/CLI/CLITypePrinter.cs +++ b/src/Generator/Generators/CLI/CLITypePrinter.cs @@ -33,8 +33,7 @@ namespace Cxxi.Generators.CLI { var arguments = function.Arguments; var returnType = function.ReturnType; - - string args = string.Empty; + var args = string.Empty; if (arguments.Count > 0) args = GetArgumentsString(function, hasNames: false); @@ -103,7 +102,7 @@ namespace Cxxi.Generators.CLI return "System::IntPtr"; } - if (pointee.IsPrimitiveType(PrimitiveType.Char)) + if (pointee.IsPrimitiveType(PrimitiveType.Char)/* && quals.IsConst*/) { return "System::String^"; } @@ -135,22 +134,19 @@ namespace Cxxi.Generators.CLI case PrimitiveType.UInt16: return "unsigned short"; case PrimitiveType.Int32: return "int"; case PrimitiveType.UInt32: return "unsigned int"; - case PrimitiveType.Int64: return "long"; - case PrimitiveType.UInt64: return "unsigned long"; + case PrimitiveType.Int64: return "long long"; + case PrimitiveType.UInt64: return "unsigned long long"; case PrimitiveType.Float: return "float"; case PrimitiveType.Double: return "double"; } - return string.Empty; + throw new NotSupportedException(); } public string VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { var decl = typedef.Declaration; - if (string.IsNullOrEmpty(decl.Name)) - return null; - TypeMap typeMap = null; if (TypeMapDatabase.FindTypeMap(decl, out typeMap)) { @@ -185,7 +181,7 @@ namespace Cxxi.Generators.CLI public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) { - throw new NotImplementedException(); + return VisitPrimitiveType(type); } public string VisitDeclaration(Declaration decl, TypeQualifiers quals)