Skip to content
UPEEC

Conditional Compilation

`#if`, `#ifdef`, `#elif`, `#else` include code only for certain builds.

Easy
Comments 0
#ifdef DEBUG
#define LOG(...) printf(__VA_ARGS__)
#else
#define LOG(...) ((void)0)
#endif

Used for platform differences and feature flags.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.