Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Integer type sizes incorrectly handled on Linux #73

Open
Labels
PR WelcomeExtra attention is needed bugSomething isn't working
@BeanCheeseBurrito

Description

Some platforms define 8-byte types like uint64_t as unsigned long int and causes CppAst to return CppPrimitiveType objects with the wrong byte size. A possible fix would be something like:

// Old
case CXTypeKind.CXType_ULong:
 return CppPrimitiveType.UnsignedInt;
// New
case CXTypeKind.CXType_ULong:
 return type.SizeOf == 8 ? CppPrimitiveType.UnsignedLongLong : CppPrimitiveType.UnsignedInt;
private CppType GetCppTypeInternal(CXCursor cursor, CXType type, CXCursor parent, void* data)
{
switch (type.kind)
{
case CXTypeKind.CXType_Void:
return CppPrimitiveType.Void;
case CXTypeKind.CXType_Bool:
return CppPrimitiveType.Bool;
case CXTypeKind.CXType_UChar:
return CppPrimitiveType.UnsignedChar;
case CXTypeKind.CXType_UShort:
return CppPrimitiveType.UnsignedShort;
case CXTypeKind.CXType_UInt:
return CppPrimitiveType.UnsignedInt;
case CXTypeKind.CXType_ULong:
return CppPrimitiveType.UnsignedInt;
case CXTypeKind.CXType_ULongLong:
return CppPrimitiveType.UnsignedLongLong;

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR WelcomeExtra attention is needed bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /