winim icon indicating copy to clipboard operation
winim copied to clipboard

Interlocked* APIs type mismatch on MinGW GCC

Open mochaaP opened this issue 9 months ago • 1 comments

The underlying type of LONG should be __LONG32, which is clong on all non-Cygwin MinGW compilers (i686-w64-mingw32-gcc / x86_64-w64-mingw32-gcc). In contrast, int32 might either int or long, depending on your stdint.h.

This generates an incompatible-pointer-types warning although the width of int and long are the same.

Error

See ntdef.h for the canonical definition:

MinGW

MSVC

Solution: mark the types as the underlying C type and assert their width instead.

mochaaP avatar May 13 '25 16:05 mochaaP

many types' sign are incorrect -- i will fix them in a pr.

mochaaP avatar May 13 '25 17:05 mochaaP