Browse Source

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
pull/14/head
Brad King 14 years ago
parent
commit
4080d5510e
  1. 2
      Modules/CMakeCCompilerId.c.in
  2. 2
      Modules/CMakeCXXCompilerId.cpp.in

2
Modules/CMakeCCompilerId.c.in

@ -20,6 +20,8 @@
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
# define COMPILER_ID "Watcom"

2
Modules/CMakeCXXCompilerId.cpp.in

@ -22,6 +22,8 @@
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
# define COMPILER_ID "Watcom"

Loading…
Cancel
Save