Browse Source

Properly handled signed chars in the AST.

pull/734/head
Dimitar Dobrev 8 years ago
parent
commit
8d322ad53e
  1. 1
      src/AST/CppTypePrinter.cs
  2. 3
      src/AST/Type.cs
  3. 1
      src/CppParser/AST.h
  4. 39
      src/CppParser/Bindings/CLI/AST.h
  5. 39
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs
  6. 39
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs
  7. 39
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs
  8. 39
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs
  9. 39
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs
  10. 39
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs
  11. 2
      src/CppParser/Parser.cpp
  12. 1
      src/Generator/Generators/CLI/CLIMarshal.cs
  13. 1
      src/Generator/Generators/CLI/CLITypePrinter.cs
  14. 1
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  15. 2
      src/Parser/ASTConverter.cs

1
src/AST/CppTypePrinter.cs

@ -119,6 +119,7 @@ namespace CppSharp.AST @@ -119,6 +119,7 @@ namespace CppSharp.AST
case PrimitiveType.Char32: return "char32_t";
case PrimitiveType.WideChar: return "wchar_t";
case PrimitiveType.Char: return "char";
case PrimitiveType.SChar: return "signed char";
case PrimitiveType.UChar: return "unsigned char";
case PrimitiveType.Short: return "short";
case PrimitiveType.UShort: return "unsigned short";

3
src/AST/Type.cs

@ -1112,6 +1112,7 @@ namespace CppSharp.AST @@ -1112,6 +1112,7 @@ namespace CppSharp.AST
Bool,
WideChar,
Char,
SChar,
UChar,
Char16,
Char32,
@ -1131,7 +1132,7 @@ namespace CppSharp.AST @@ -1131,7 +1132,7 @@ namespace CppSharp.AST
LongDouble,
Float128,
IntPtr,
UIntPtr,
UIntPtr
}
/// <summary>

1
src/CppParser/AST.h

@ -290,6 +290,7 @@ enum class PrimitiveType @@ -290,6 +290,7 @@ enum class PrimitiveType
Bool,
WideChar,
Char,
SChar,
UChar,
Char16,
Char32,

39
src/CppParser/Bindings/CLI/AST.h

@ -360,25 +360,26 @@ namespace CppSharp @@ -360,25 +360,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
};
public enum struct ExceptionSpecType

39
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

@ -253,25 +253,26 @@ namespace CppSharp @@ -253,25 +253,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
}
public enum ExceptionSpecType

39
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

@ -253,25 +253,26 @@ namespace CppSharp @@ -253,25 +253,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
}
public enum ExceptionSpecType

39
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs

@ -253,25 +253,26 @@ namespace CppSharp @@ -253,25 +253,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
}
public enum ExceptionSpecType

39
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs

@ -253,25 +253,26 @@ namespace CppSharp @@ -253,25 +253,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
}
public enum ExceptionSpecType

39
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs

@ -253,25 +253,26 @@ namespace CppSharp @@ -253,25 +253,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
}
public enum ExceptionSpecType

39
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs

@ -253,25 +253,26 @@ namespace CppSharp @@ -253,25 +253,26 @@ namespace CppSharp
Bool = 2,
WideChar = 3,
Char = 4,
UChar = 5,
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
SChar = 5,
UChar = 6,
Char16 = 7,
Char32 = 8,
Short = 9,
UShort = 10,
Int = 11,
UInt = 12,
Long = 13,
ULong = 14,
LongLong = 15,
ULongLong = 16,
Int128 = 17,
UInt128 = 18,
Half = 19,
Float = 20,
Double = 21,
LongDouble = 22,
Float128 = 23,
IntPtr = 24
}
public enum ExceptionSpecType

2
src/CppParser/Parser.cpp

@ -1875,7 +1875,7 @@ static PrimitiveType WalkBuiltinType(const clang::BuiltinType* Builtin) @@ -1875,7 +1875,7 @@ static PrimitiveType WalkBuiltinType(const clang::BuiltinType* Builtin)
case clang::BuiltinType::Void: return PrimitiveType::Void;
case clang::BuiltinType::Bool: return PrimitiveType::Bool;
case clang::BuiltinType::SChar:
case clang::BuiltinType::SChar: return PrimitiveType::SChar;
case clang::BuiltinType::Char_S: return PrimitiveType::Char;
case clang::BuiltinType::UChar:

1
src/Generator/Generators/CLI/CLIMarshal.cs

@ -213,6 +213,7 @@ namespace CppSharp.Generators.CLI @@ -213,6 +213,7 @@ namespace CppSharp.Generators.CLI
case PrimitiveType.Bool:
case PrimitiveType.Char:
case PrimitiveType.WideChar:
case PrimitiveType.SChar:
case PrimitiveType.UChar:
case PrimitiveType.Short:
case PrimitiveType.UShort:

1
src/Generator/Generators/CLI/CLITypePrinter.cs

@ -208,6 +208,7 @@ namespace CppSharp.Generators.CLI @@ -208,6 +208,7 @@ namespace CppSharp.Generators.CLI
case PrimitiveType.Char32:
case PrimitiveType.WideChar: return "System::Char";
case PrimitiveType.Char: return Options.MarshalCharAsManagedChar ? "System::Char" : "char";
case PrimitiveType.SChar: return "signed char";
case PrimitiveType.UChar: return "unsigned char";
case PrimitiveType.Short: return "short";
case PrimitiveType.UShort: return "unsigned short";

1
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -582,6 +582,7 @@ namespace CppSharp.Generators.CSharp @@ -582,6 +582,7 @@ namespace CppSharp.Generators.CSharp
ContextKind != CSharpTypePrinterContextKind.Native
? "char"
: "sbyte";
case PrimitiveType.SChar: return "sbyte";
case PrimitiveType.UChar: return "byte";
case PrimitiveType.Short:
case PrimitiveType.UShort:

2
src/Parser/ASTConverter.cs

@ -730,6 +730,8 @@ namespace CppSharp @@ -730,6 +730,8 @@ namespace CppSharp
return AST.PrimitiveType.Char;
case PrimitiveType.UChar:
return AST.PrimitiveType.UChar;
case PrimitiveType.SChar:
return AST.PrimitiveType.SChar;
case PrimitiveType.Char16:
return AST.PrimitiveType.Char16;
case PrimitiveType.Char32:

Loading…
Cancel
Save