diff --git a/src/AST/CppTypePrinter.cs b/src/AST/CppTypePrinter.cs index f67d9f57..a5e6811f 100644 --- a/src/AST/CppTypePrinter.cs +++ b/src/AST/CppTypePrinter.cs @@ -103,7 +103,8 @@ namespace CppSharp.AST { case PrimitiveType.Bool: return "bool"; case PrimitiveType.Void: return "void"; - case PrimitiveType.Char16: + case PrimitiveType.Char16: return "char16_t"; + case PrimitiveType.Char32: return "char32_t"; case PrimitiveType.WideChar: return "wchar_t"; case PrimitiveType.Char: return "char"; case PrimitiveType.UChar: return "unsigned char"; @@ -115,9 +116,13 @@ namespace CppSharp.AST case PrimitiveType.ULong: return "unsigned long"; case PrimitiveType.LongLong: return "long long"; case PrimitiveType.ULongLong: return "unsigned long long"; + case PrimitiveType.Int128: return "__int128_t"; + case PrimitiveType.UInt128: return "__uint128_t"; + case PrimitiveType.Half: return "__fp16"; case PrimitiveType.Float: return "float"; case PrimitiveType.Double: return "double"; case PrimitiveType.LongDouble: return "long double"; + case PrimitiveType.Float128: return "__float128"; case PrimitiveType.IntPtr: return "void*"; case PrimitiveType.UIntPtr: return "uintptr_t"; case PrimitiveType.Null: return "std::nullptr_t"; diff --git a/src/AST/Type.cs b/src/AST/Type.cs index 6f613335..4024365d 100644 --- a/src/AST/Type.cs +++ b/src/AST/Type.cs @@ -1015,6 +1015,8 @@ namespace CppSharp.AST WideChar, Char, UChar, + Char16, + Char32, Short, UShort, Int, @@ -1023,12 +1025,15 @@ namespace CppSharp.AST ULong, LongLong, ULongLong, + Int128, + UInt128, + Half, Float, Double, LongDouble, + Float128, IntPtr, UIntPtr, - Char16 } /// diff --git a/src/Core/Parser/ASTConverter.cs b/src/Core/Parser/ASTConverter.cs index 52c290c0..eb21202e 100644 --- a/src/Core/Parser/ASTConverter.cs +++ b/src/Core/Parser/ASTConverter.cs @@ -673,6 +673,10 @@ namespace CppSharp return AST.PrimitiveType.Char; case PrimitiveType.UChar: return AST.PrimitiveType.UChar; + case PrimitiveType.Char16: + return AST.PrimitiveType.Char16; + case PrimitiveType.Char32: + return AST.PrimitiveType.Char32; case PrimitiveType.Short: return AST.PrimitiveType.Short; case PrimitiveType.UShort: @@ -689,12 +693,20 @@ namespace CppSharp return AST.PrimitiveType.LongLong; case PrimitiveType.ULongLong: return AST.PrimitiveType.ULongLong; + case PrimitiveType.Int128: + return AST.PrimitiveType.Int128; + case PrimitiveType.UInt128: + return AST.PrimitiveType.UInt128; + case PrimitiveType.Half: + return AST.PrimitiveType.Half; case PrimitiveType.Float: return AST.PrimitiveType.Float; case PrimitiveType.Double: return AST.PrimitiveType.Double; case PrimitiveType.LongDouble: return AST.PrimitiveType.LongDouble; + case PrimitiveType.Float128: + return AST.PrimitiveType.Float128; case PrimitiveType.IntPtr: return AST.PrimitiveType.IntPtr; default: diff --git a/src/CppParser/AST.h b/src/CppParser/AST.h index a87fe2d3..f2a91741 100644 --- a/src/CppParser/AST.h +++ b/src/CppParser/AST.h @@ -258,6 +258,8 @@ enum class PrimitiveType WideChar, Char, UChar, + Char16, + Char32, Short, UShort, Int, @@ -266,9 +268,13 @@ enum class PrimitiveType ULong, LongLong, ULongLong, + Int128, + UInt128, + Half, Float, Double, LongDouble, + Float128, IntPtr }; diff --git a/src/CppParser/Bindings/CLI/AST.h b/src/CppParser/Bindings/CLI/AST.h index 5b39a290..3f063110 100644 --- a/src/CppParser/Bindings/CLI/AST.h +++ b/src/CppParser/Bindings/CLI/AST.h @@ -330,18 +330,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 }; public enum struct MacroLocation diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs index cb8e3b8a..c4fc95fe 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs @@ -225,18 +225,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 } public enum MacroLocation diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs index 2967b8aa..8dee95f6 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs @@ -225,18 +225,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 } public enum MacroLocation diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs index 4bc3a794..0a868392 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs @@ -225,18 +225,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 } public enum MacroLocation diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs index b1edc979..75258dab 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs @@ -225,18 +225,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 } public enum MacroLocation diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs index 37cd58e7..625b69ae 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs @@ -225,18 +225,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 } public enum MacroLocation diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs index 08284259..8465c1cc 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs @@ -225,18 +225,24 @@ namespace CppSharp WideChar = 3, Char = 4, UChar = 5, - Short = 6, - UShort = 7, - Int = 8, - UInt = 9, - Long = 10, - ULong = 11, - LongLong = 12, - ULongLong = 13, - Float = 14, - Double = 15, - LongDouble = 16, - IntPtr = 17 + Char16 = 6, + Char32 = 7, + Short = 8, + UShort = 9, + Int = 10, + UInt = 11, + Long = 12, + ULong = 13, + LongLong = 14, + ULongLong = 15, + Int128 = 16, + UInt128 = 17, + Half = 18, + Float = 19, + Double = 20, + LongDouble = 21, + Float128 = 22, + IntPtr = 23 } public enum MacroLocation diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 62ba3aa6..30d3aa49 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -1876,6 +1876,9 @@ static PrimitiveType WalkBuiltinType(const clang::BuiltinType* Builtin) case clang::BuiltinType::WChar_S: case clang::BuiltinType::WChar_U: return PrimitiveType::WideChar; + case clang::BuiltinType::Char16: return PrimitiveType::Char16; + case clang::BuiltinType::Char32: return PrimitiveType::Char32; + case clang::BuiltinType::Short: return PrimitiveType::Short; case clang::BuiltinType::UShort: return PrimitiveType::UShort; @@ -1888,9 +1891,14 @@ static PrimitiveType WalkBuiltinType(const clang::BuiltinType* Builtin) case clang::BuiltinType::LongLong: return PrimitiveType::LongLong; case clang::BuiltinType::ULongLong: return PrimitiveType::ULongLong; + case clang::BuiltinType::Int128: return PrimitiveType::Int128; + case clang::BuiltinType::UInt128: return PrimitiveType::UInt128; + + case clang::BuiltinType::Half: return PrimitiveType::Half; case clang::BuiltinType::Float: return PrimitiveType::Float; case clang::BuiltinType::Double: return PrimitiveType::Double; case clang::BuiltinType::LongDouble: return PrimitiveType::LongDouble; + case clang::BuiltinType::Float128: return PrimitiveType::Half; case clang::BuiltinType::NullPtr: return PrimitiveType::Null; diff --git a/src/Generator/Generators/CLI/CLITypePrinter.cs b/src/Generator/Generators/CLI/CLITypePrinter.cs index 0ce27759..f08e0aee 100644 --- a/src/Generator/Generators/CLI/CLITypePrinter.cs +++ b/src/Generator/Generators/CLI/CLITypePrinter.cs @@ -206,6 +206,7 @@ namespace CppSharp.Generators.CLI case PrimitiveType.Bool: return "bool"; case PrimitiveType.Void: return "void"; case PrimitiveType.Char16: + case PrimitiveType.Char32: case PrimitiveType.WideChar: return "System::Char"; case PrimitiveType.Char: return Options.MarshalCharAsManagedChar ? "System::Char" : "char"; case PrimitiveType.UChar: return "unsigned char"; diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 03298368..50c03371 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -544,6 +544,7 @@ namespace CppSharp.Generators.CSharp "byte" : "bool"; case PrimitiveType.Void: return "void"; case PrimitiveType.Char16: + case PrimitiveType.Char32: case PrimitiveType.WideChar: return "char"; case PrimitiveType.Char: // returned structs must be blittable and char isn't