Skip to content

Inconsistent use of datatypes #642

Description

@CounterPillow

Compilation breaks for me using msys2 with mingw-w64 due to inconsistent uses of datatypes, and generally datatype weirdness.

ImPlatform.h defines INT32 and friends, but the system's basetsd.h which appears to get included somewhere already does this. These two seem to conflict on my system, yielding fun errors such as

D:/msys64/mingw64/x86_64-w64-mingw32/include/basetsd.h:35:30: error: expected identifier or '(' before ',' token

   typedef unsigned int UINT32,*PUINT32;

So basically, I ripped out most of ImPlatform.h and just made it include basetsd.h (which appears to get included somewhere else anyway?)
However, basetsd.h does not #define them to things like int, but rather typedefs it to signed int, which means that code like Lzw.h line 48 (unsigned INT16 link[LZWTABLE];) and Gif.h, line 62 fails to build, as it uses unsigned INT16 instead of UINT16. (which ImPlatform.h would define already as well)
Changing unsigned INT16 to UINT16 in these two instances allows the code to build.

Why basetsd.h gets included and then conflicts with ImPlatform.h, I do not know; however, using the predefined datatypes consistently would probably be good practice anyway, which is what I'm opening this issue for.

Note: My nickname is not actually a joke on the library's name, it's coincidence, I swear!

Activity

  1. added a commit that references this issue on Apr 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions