Software that runs in several system environments often
contains some source code that is environmentally dependent.
Conditional compilation — the selective inclusion or
exclusion of portions of the source code at compile time —
is one technique that is often used to assist in the
maintenance of such source code.
Conditional compilation is sometimes done with "smart
comments" — definitions that either skip or do not skip
the remainder of the line based on some test. For example:
This technique works on a line by line basis, and is good for
short, isolated variant code sequences.
More complicated conditional compilation problems suggest a
nestable method that can encompass more than one source line
at a time. The words included in the optional Programming tools
extensions word set are useful for this purpose.