diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index aa32e2bc..84d342ec 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -802,10 +802,14 @@ namespace CppSharp.Generators.CSharp return; var arrayType = field.QualifiedType.Type.Desugar() as ArrayType; - // we do not support long double yet because its representation in C# is problematic - if ((arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant && - arrayType.Type.IsPrimitiveType(PrimitiveType.LongDouble)) || - field.QualifiedType.Type.IsPrimitiveType(PrimitiveType.LongDouble)) + var coreType = field.QualifiedType.Type.Desugar(); + if (arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant) + coreType = arrayType.Type.Desugar(); + // we do not support the primitives below yet because their representation in C# is problematic + if (coreType.IsPrimitiveType(PrimitiveType.LongDouble) || + coreType.IsPrimitiveType(PrimitiveType.Int128) || + coreType.IsPrimitiveType(PrimitiveType.UInt128) || + coreType.IsPrimitiveType(PrimitiveType.Half)) return; var safeIdentifier = Helpers.SafeIdentifier(field.Name); diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index cbf732c4..6bd20bcc 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -560,6 +560,9 @@ namespace CppSharp.Generators.CSharp case PrimitiveType.LongLong: case PrimitiveType.ULongLong: return GetIntString(primitive, driver.TargetInfo); + case PrimitiveType.Int128: return "__int128"; + case PrimitiveType.UInt128: return "__uint128_t"; + case PrimitiveType.Half: return "__fp16"; case PrimitiveType.Float: return "float"; case PrimitiveType.Double: return "double"; // not really supported yet but it's closest, and we don't want crashes when parsing long doubles