aoineko-fr / MSXgl

The MSX Game Library in C language
113 stars 9 forks source link

not detecting VGM header (GCC) #19

Closed pvmm closed 1 year ago

pvmm commented 1 year ago

Fix it and warn user about it in case it fails.

aoineko-fr commented 1 year ago

Fixed

pvmm commented 1 year ago

I tried using your changes, but it still doesn't work. Then I checked why:

printf("%li\n", sizeof(u32));

Size of u32 is 8 on GNU/Linux. There is no guarantee that unsigned long is of the type you expects, because it is architecture-specific.

You should #include <stdint.h> or <cstdint> (which I guess windows supports since MSVC2010) and use uint32_t instead which specifies the bits precisely and is guaranteed to be the size you want.

aoineko-fr commented 1 year ago

Fixed using standard C type for integers