From 4080d5510e5a97de8f3659b5ca4c88d17b81f31d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Dec 2011 12:06:06 -0500 Subject: 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 --- Modules/CMakeCCompilerId.c.in | 2 ++ Modules/CMakeCXXCompilerId.cpp.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index e9a8efd..5afe99f 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/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" diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index bdc520c..4c42f8a 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/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" -- cgit v0.12