I know Windows uses LLP instead of the LP data model, but is there a predefined variable or something? on OS X/Linux you can use __LP64__
.
__LP64__ on Windows?
5.7k Views Asked by JT. At
3
There are 3 best solutions below
2

I don't know if such variable, but you can test for _MSC_VER
, which will be defined in Visual Studio. You can then assume an LLP model. If that ever changes in the future, you can use the value of _MSC_VER
to test against compiler versions.
If you're looking for standard sized types, check out boost::integer, which defines fixed-bit-sized integer types.
Do you really need a preprocessor variable (depending on the case, it might be required, but you may also be able to do without)? Is
sizeof(long) == sizeof(void*)
not good enough?