[prev] [index] [next]

Variations (cont)

How do we set a cpp definition such as BSD or linux?
  • via an explicit #define in the source code   (e.g. config.h)

    #define BSD 4
    #define linux
    

  • via the -D flag to the C compiler

    gcc -DBSD=4 blah.c
    

  • some definitions are built-in to the pre-processor

    #define i386
    

A cpp trick:   #if 0   causes code to be ignored   ("commented out").