Where is __LP64__ defined for default builds of C++ applications on OSX 10.6?

左心房为你撑大大i 提交于 2019-12-04 13:42:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!