I would like to ‘turn off’ the compiler for a section of my code. I do not want to use comments to ‘hide’ the code from the compiler because there are a lot of /*...*/ comments embedded in this section. I would guess that there is a common way to use compiler directives or #defines or something to control the compilation. In fact my desire to suppress compilation is not dependent on a condition like the SDK or the platform, I would just like to turn it off. How does one accomplish this?
I would like to ‘turn off’ the compiler for a section of my code.
Share
A quick fix is to wrap that section of code with
where 0 means false. To enable it again,
Another option is to define a macro (Project Info -> Build -> Preprocessor macros) and define it when you want to disable that code, and undefine it when you want to enable that code. For instance,
You can achieve a similar, ‘inverse’ effect by using
#ifdefinstead.