Closed pvmm closed 1 year ago
Fixed
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.
Fixed using standard C type for integers
Fix it and warn user about it in case it fails.