0

With in a source code I know you can use platform specific information such as

#ifdef __APPLE__  

or

#ifdef __ANDROID__

I am working on a new platform and need to use such macros. Where does the definition occur? If it is done at the compiler, where can i look to find this information?

It is said that the NaCl MACRO for instance is defined at the compiler as follows:

/* The NACL compiler defines __native_client__ and __pnacl__
* Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
*/

EDIT: I guess I'm Looking for predefined compiler macros like the ones mentioned in http://sourceforge.net/p/predef/wiki/Compilers/. But is there a way I can look into a given compiler to find these information to find additional information? The one I use is based on arm-gcc.

Jay Chung
  • 175
  • 1
  • 1
  • 11
  • 1
    *If it is done at the compiler, where can i look to find this information?* Which *the compiler* are we talking about here? – ta.speot.is Sep 26 '14 at 03:32
  • @ta.speot.is its an arm-gcc based compiler, which I dont have enough information about. – Jay Chung Sep 26 '14 at 03:57
  • There is another question somewhere on SO that has a method of getting the predefined macros from GCC. In fact, I've now closed this as a duplicate of one of them — I'm not sure whether there are others. – Jonathan Leffler Sep 26 '14 at 03:59

1 Answers1

0

Some sources:

http://www.netbsd.org/docs/pkgsrc/fixes.html#fixes.build.cpp
http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/predefined-macros-platform.html

Boost has a library Predef that define a lot of macro of a lot of platform too.

NetVipeC
  • 4,402
  • 1
  • 17
  • 19