Jump to content

Conditional compilation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 63.87.189.17 (talk) at 19:20, 21 August 2009 (Many other languages than C do conditional compilation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer programming, conditional compilation refers to methods which allow the compiler to produce slight differences in a program depending on parameters that are provided during compilation. This technique is commonly used when these differences are needed to run the software on different platforms, or with different versions of required libraries or hardware.

Many programming languages support various methods of doing this. For example, in C, and some languages with a similar syntax, this is done using an '#ifdef' directive.