I am having a project ported on Windows in MSVC.
I am using following pragma to know which define I am compiling and it gives info on build console.
#pragma message("DEFINES USED: 1")
Is there any equivalent to this in TI
Also I need to give #error in case of some not possible define combination to dis-allow compilation with some message
or #warning to allow compialtion with some warning.
Any clue, how to do it in TI?
-
Mukul KABRA
#error is a standard C feature, so you can just use that. TI additionally provides #warn, which works like #error but only emits a warning. There is no "#pragma message", but you could just use #warn
#error is OK, because even if write a wrong syntax without #error in some #define combination protectioncode will stop compiling, that is what I want
But for #warning or #warn ...
I have following code and CCS do not behaves correctly. Even #warn does not become red (recognised compiler directive) in CCS editor
--------------------
#define QUOTE_VAL(x) QUOTE(x)#define QUOTE(x) #x
#define MY_DEF 5
#ifdef WIN32
#pragma message(" My define Value : QUOTE_VAL(MY_DEF)")
#else
#warn "My define Value :" QUOTE_VAL(MY_DEF)
#endif
-------------------
MSVC Output
My define Value : 5
TI Output
"My define Value :" QUOTE_VAL(MY_DEF)