What Is Conditional Compiling?
Conditional compiling is a very basic concept that enables you to do some pretty powerful things. Basically, conditional compiling enables you to compile parts of your code based on a certain condition defined at compile time. Generally, this is used if you have a debugging function that you do not want to include in your release build. Or, you might have a function that you want two versions of: one for your debugging and one for a release. The debug version might be littered with output statements or other code that would be too slow to execute in a release environment. With conditional compiling, you could create two versions of the function and flip the switch on which one should be compiled in your program, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access