LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to use Release/Debug pre-processor directives?

I have some code that is annoying to debug due to lots of useless (during debugging) user interaction that I would like to compile out for my debugging.  Is there anyway to use pre-processor directives to achieve this?
 
Ty
0 Kudos
Message 1 of 4
(3,678 Views)

It's not clear to me if you don't want to execute parts of code when executing in debug mode or if you want to completely exclude them from compilation.

In the first case you could enclose those parts into a if (!BeingDebuggedByCVI ()) {  } structure: they will be compiled but not executed if in debug mode; in the latter case you could use the #ifdef YOUR_MACRO and #endif preprocessor directives to enclose the lines not to compile: if there is a #define YOUR_MACRO directive the lines will be compiled (and executed) , otherwise they won't.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(3,674 Views)
Also _CVI_DEBUG_ is defined to be 1 if the Build==> Configuration is set to debug mode.
Message 3 of 4
(3,670 Views)
That is perfect. Thanks
0 Kudos
Message 4 of 4
(3,667 Views)