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?
#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
#pragma message(" My define Value : QUOTE_VAL(MY_DEF)")
#warn "My define Value :" QUOTE_VAL(MY_DEF)
My define Value : 5
"My define Value :" QUOTE_VAL(MY_DEF)
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.