09-19-2017 06:43 AM
Hello all,
in cvicc (CVI compiler for Linux), there's an option -DDEFINE to define a macro, but no equivalent -U to undefine it. It would be useful because the macros defined in [Options][Build Options][Compiler defines] are indeed used by cvicc when compiling on Linux. If I need a project-level macro defined on Windows but not on Linux, I don't know how to remove it except by parsing it out of the prj file before compilation.
09-20-2017 04:19 PM
Hello,
Great input. Can you post this on NI Idea Exchange? That is where the developers look for input for software changes.
09-21-2017 08:57 AM
09-25-2017 02:45 AM
Hello gdargaud,
If you want to have macros defined conditionally I suggest you to use a Precompiled Header instead of Compilers Defines in Build Options. Then in the prefix header add your defines conditionally:
#if _NI_mswin_ // windows defines #define _MINUS_U #else // linux defines #endif
You don't have to #include this header in *.c files because it is included automatically
I hope it helps.
Constantin
09-25-2017 04:26 AM
Thanks Constantin,
I'd never noticed that CVI supports precompiled headers. With fast computers nowadays, I've never felt the needs for them, but I'll keep it in mind in that case.