▲ | colleagueRiley 3 days ago | |||||||||||||||||||||||||||||||
I test Windows mainly with MINGW, that might be an issue with MSVC. Feel free to report the issue on the github repository. I'm pretty sure windows uses "long" for 64 bit but linux uses "long long" for 64 bit | ||||||||||||||||||||||||||||||||
▲ | flohofwoe 3 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
Since you're using C99 as the base C version, why not use the fixed-width types from stdint.h (int32_t, int64_t, ...)? You can still typedef those to i32, i64 shortcuts etc, but I would try to avoid this in libraries since it might collide with user typedefs of the same name - or at least try to avoid it in the public API declarations. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | tredre3 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
> I'm pretty sure windows uses "long" for 64 bit but linux uses "long long" for 64 bit Windows long is 32bit even on 64bit CPUs. Linux long is arch dependent and is 64bit on x64, 32bit on x86. long long is always 64bit on both platforms. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | eska 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
It's just that the #if checks for the MSVC compiler, not for Windows as a platform. And on that compiler you will never have LP64, but LLP64: https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_m... I just roll my own for this because I don't need all the functionality, and generally find such cross-platform libraries to only really test on Linux, and it's too much of a hassle. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | Iwan-Zotow 2 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
> I'm pretty sure windows uses "long" for 64 bit but linux uses "long long" for 64 bit other way around |