Who defines the platform specific macros eg LINUX VXWORKS etc



Are these macros defined in Makefile or by some environment which can
detect the platform types?

/* common code here */

#ifdef LINUX

/* other os spefic code */

#elif defined VXWORKS

/* other os spefic code */

#elif defined MACOSX

/* other os spefic code */

#elif defined WIN32

/* other os spefic code */

#endif

/* common code here */
.



Relevant Pages

  • Re: plataform dependent code
    ... >I am using wxPython and i want to have some code plataform dependent. ... import sys ... if sys.platform == 'win32': ... elif sys.platform == 'linux2': ...
    (comp.lang.python)
  • Is there a OS name defined by gcc or g++?
    ... I'm looking something like a compiler under Win32 will define _WIN32 ... so then I can have my conditional code thus: ... #elif defined LINUX ...
    (comp.os.linux.development.apps)