When running on Leopard you can do something like:
#if __LP64__
#pragma message ("64 bit Leopard issue")
#endif
What is Snow Leopard and Snow Leopard 64
AND (most importantly)
Where would I have found this answer myself and not had to ask?
When running on Leopard you can do something like:
#if __LP64__
#pragma message ("64 bit Leopard issue")
#endif
What is Snow Leopard and Snow Leopard 64
AND (most importantly)
Where would I have found this answer myself and not had to ask?
__LP64__
is a gcc preprocessor macro that is nonzero whenever you are building the 64bit data model regardless of the OS X version you are building on. Another macro that will be nonzero is __x86_64__
when building for 64bit Intel processors. You can find more information about these and other macros at developer.apple.com.
You can specify a deployment target for your XCode project, which will specify the minimum permissible OS version on which your application can run. You can leverage this setting in your code to conditionally enable/disable parts of it; see this mailing list post for more info.
__LP64__
is not an abbreviation of "Leopard 64". It stands for "longs and pointers are 64 bits". It is set on SnowLeopard in exactly the same circumstances as it is on Leopard.
__LP64__
will not have the same behavior on windows, because windows uses a different 64-bit model, in which longs are not 64 bits wide. Instead, in 64-bit windows, long is 32 bits wide and long longs and pointers are 64 bits wide. This is commonly referred to as the "llp64" model.