Detect TI compiler version with its id

Decode decimal digits from __TI_COMPILER_VERSION__ to compute version
number components.  See documentation at:

  http://processors.wiki.ti.com/index.php/Refer_to_Compiler_Version_in_Your_Source
  http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spru187o
  http://sourceforge.net/p/predef/wiki/Compilers/#texas-instruments-cc-compiler
This commit is contained in:
Brad King 2012-08-22 10:15:58 -04:00
parent 74c57d99b4
commit 952651c642
2 changed files with 8 additions and 0 deletions

View File

@ -108,6 +108,10 @@
#elif defined(__TI_COMPILER_VERSION__) #elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP" # define COMPILER_ID "TI_DSP"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__TINYC__) #elif defined(__TINYC__)
# define COMPILER_ID "TinyCC" # define COMPILER_ID "TinyCC"

View File

@ -110,6 +110,10 @@
#elif defined(__TI_COMPILER_VERSION__) #elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP" # define COMPILER_ID "TI_DSP"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__SCO_VERSION__) #elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO" # define COMPILER_ID "SCO"