Refer to Compiler Version in Your Source
From Texas Instruments Embedded Processors Wiki
Translate this page to
Sometimes you need to refer to the version of the compiler from your source code. You can use the compiler predefined preprocessor macro __TI_COMPILER_VERSION__. Here is an example.
// ver_ex.c // Examples of how to use __TI_COMPILER_VERSION__, the preprocessor // symbol predefined by all TI compilers int val = __TI_COMPILER_VERSION__; // as an int #define EVAL_TO_STR(arg) #arg #define MKSTR(arg) EVAL_TO_STR(arg) char *cgt_version = MKSTR(__TI_COMPILER_VERSION__); // as a string
Note relatively old versions of TI compilers do not supply __TI_COMPILER_VERSION__. To see if your compiler supports it, preprocess the example with the option -ppc and examine the resulting .pp file. If __TI_COMPILER_VERSION__ is supported, it will look something like this.
C:\dir>cl6x -ppc ver_ex.c C:\dir>type ver_ex.pp // ver_ex.c // Examples of how to use __TI_COMPILER_VERSION__, the preprocessor // symbol predefined by all TI compilers int val = 6001000; // as an int char *cgt_version = "6001000"; // as a stringLeave a Comment
