Detect Borland compiler version with its id
Decode hex digits from __BORLANDC__ to compute the version number components. Note that the constant encodes decimal digits as hex digits (never larger than 9). We represent them as decimal after extraction. See documentation at http://predef.sourceforge.net/precomp.html http://docwiki.embarcadero.com/RADStudio/en/Predefined_Macros
This commit is contained in:
parent
2cc205a0fb
commit
4080d5510e
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#elif defined(__BORLANDC__)
|
#elif defined(__BORLANDC__)
|
||||||
# define COMPILER_ID "Borland"
|
# define COMPILER_ID "Borland"
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||||
|
|
||||||
#elif defined(__WATCOMC__)
|
#elif defined(__WATCOMC__)
|
||||||
# define COMPILER_ID "Watcom"
|
# define COMPILER_ID "Watcom"
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#elif defined(__BORLANDC__)
|
#elif defined(__BORLANDC__)
|
||||||
# define COMPILER_ID "Borland"
|
# define COMPILER_ID "Borland"
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||||
|
|
||||||
#elif defined(__WATCOMC__)
|
#elif defined(__WATCOMC__)
|
||||||
# define COMPILER_ID "Watcom"
|
# define COMPILER_ID "Watcom"
|
||||||
|
|
Loading…
Reference in New Issue