Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 714
Dan Nissenbaum Avatar asked Jul 16 '11 23:07

Dan Nissenbaum


1 Answers

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.)

like image 50
Jonathan Grynspan Avatar answered Oct 22 '22 16:10

Jonathan Grynspan