2007-11-26

GCC Predefined Macros

As a follow-up to my earlier post on macros for detecting compilers, OSes and hardware, here's an easy way to find all the macros GCC is predefining for you:

echo | gcc -dM -E -x objective-c -arch ppc -mmacosx-version-min=10.3 -

Obviously, substitute the appropriate language, architectures, and minimum Mac OS X version. The languages are c, objective-c, c++ and objective-c++. The architectures (as of Leopard) are ppc, i386, ppc64 and x86_64.

0 comments: