3 ms·
Author here (late to the discussion, nobody told me my 2008 article was posted on hackernews...) > If DWORD is declared, then your Mac code can use it fine. >
by brianwski 12y ago
Author here (late to the discussion, nobody told me my 2008 article was posted on hackernews...)
> If DWORD is declared, then your Mac code can use it fine.
> If it's not, then it won't even compile.
Correct -> as a WINDOWS programmer you think it's fine because it compiles just fine. The point is it then won't compile on the Mac, or on Linux, or any other platform. The whole point is if you want a 32 bit integer, use a cross platform 32 bit integer from the beginning. When a Macintosh programmer goes to compile, it will compile. ONLY IF you need to call a Windows specific call, then type cast or convert into the Windows specific type, and then you do it inside an #ifdef. But most all of the time Windows programmers seem to love their DWORDS and they use them all over the place, even for public APIs that some other poor Macintosh programmer has to replace later. Why not start with the cross platform version? What does a DWORD get you that "int32_t" does not? (NOTE: we make sure "int32_t" is defined and a 32 bit integer on all of our platforms, then everybody uses the same thing.)