garrynewman/gmad — pull request #11 by cyining (2014-10-21 11:18:41+00:00)
Title: Fix iCRC type to make it 4-byte on both 32-bit and 64-bit platforms

Tried in both OSX (Mountain Lion 64-bit) and Linux (Debian Jessie i386) to extract .gma files, and found some inconsistency between the two. It runs fine in 32-bit Linux, but has some problem in 64-bit OSX. After some digging, it turns out that "unsigned long" have different size in 32-bit and 64-bit platforms.

sizeof(unsigned int) is 4 on both 32-bit and 64-bit platforms.
sizeof(unsigned long) is 4 on 32-bit platform and 8 on 64-bit one.

http://stackoverflow.com/questions/13335587/sizeof-unsigned-int-in-microsoft-x64-compiler