问题
I am building a 3rd-party library in 32-bit mode on OSX 10.6 (the library is Xerces 2.8). I have determined that the preprocessor definition __LP64__ is set. However, as far as I can see it is not being set within any configuration files of the 3rd-party project, and doing a global search through all files (via the Finder) for #define __LP64__ does not reveal to me where this is being defined by the system.
I am building the library via make at the command line (Xcode is not involved).
I would like to know where __LP64__ is defined - and what its purpose is, given that I am building the project in 32-bit mode.
回答1:
It's defined automatically by the compiler rather than in any header. If it's set, you're building for 64-bit targets.
(A header could define it if the compiler hasn't already, though it shouldn't. If you think this is the case, add #define __LP64__ to your code, and look at the error during preprocessing to determine the location of the previous define.)
来源:https://stackoverflow.com/questions/6721037/where-is-lp64-defined-for-default-builds-of-c-applications-on-osx-10-6