summaryrefslogtreecommitdiffstats
path: root/Modules/CMakePlatformId.h.in
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-01-17 21:22:53 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-01-17 21:22:53 (GMT)
commit4dd47eb6c394c54bde00ebd0d99a8c01c7128b9f (patch)
treed82076ceed295758065dba3a8091bfa482bc0c22 /Modules/CMakePlatformId.h.in
parentd9d24e2196a76dc6606d5972d382467c010c9f4e (diff)
parent0df1942a72f1e67c88f0d02dc405fbd76793347a (diff)
downloadCMake-4dd47eb6c394c54bde00ebd0d99a8c01c7128b9f.zip
CMake-4dd47eb6c394c54bde00ebd0d99a8c01c7128b9f.tar.gz
CMake-4dd47eb6c394c54bde00ebd0d99a8c01c7128b9f.tar.bz2
Merge topic 'compiler-version'
0df1942 Detect SGI MIPSpro compiler version with its id a5e892c Document compiler version macro formats used for detection d7c6f41 Detect HP compiler version with its id 3dd9fa9 Detect SunPro compiler version with its id c198730 Detect Watcom compiler version with its id 5899b98 Detect Clang compiler version with its id b8cfa65 Detect PGI compiler version with its id 6dae666 Detect IBM XL compiler version with its id 4080d55 Detect Borland compiler version with its id 2cc205a Detect Intel compiler version with its id (#11937) a6d83cc Detect MSVC compiler version with its id a662855 Detect GNU compiler version with its id (#6251) fa7141f Add framework to detect compiler version with its id (#12408)
Diffstat (limited to 'Modules/CMakePlatformId.h.in')
-rw-r--r--Modules/CMakePlatformId.h.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index cb3f40a..b69bf63 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -105,6 +105,46 @@
# define ARCHITECTURE_ID ""
#endif
+/* Convert integer to decimal digit literals. */
+#define DEC(n) \
+ ('0' + (((n) / 10000000)%10)), \
+ ('0' + (((n) / 1000000)%10)), \
+ ('0' + (((n) / 100000)%10)), \
+ ('0' + (((n) / 10000)%10)), \
+ ('0' + (((n) / 1000)%10)), \
+ ('0' + (((n) / 100)%10)), \
+ ('0' + (((n) / 10)%10)), \
+ ('0' + ((n) % 10))
+
+/* Convert integer to hex digit literals. */
+#define HEX(n) \
+ ('0' + ((n)>>28 & 0xF)), \
+ ('0' + ((n)>>24 & 0xF)), \
+ ('0' + ((n)>>20 & 0xF)), \
+ ('0' + ((n)>>16 & 0xF)), \
+ ('0' + ((n)>>12 & 0xF)), \
+ ('0' + ((n)>>8 & 0xF)), \
+ ('0' + ((n)>>4 & 0xF)), \
+ ('0' + ((n) & 0xF))
+
+/* Construct a string literal encoding the version number components. */
+#ifdef COMPILER_VERSION_MAJOR
+char const info_version[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
+ COMPILER_VERSION_MAJOR,
+# ifdef COMPILER_VERSION_MINOR
+ '.', COMPILER_VERSION_MINOR,
+# ifdef COMPILER_VERSION_PATCH
+ '.', COMPILER_VERSION_PATCH,
+# ifdef COMPILER_VERSION_TWEAK
+ '.', COMPILER_VERSION_TWEAK,
+# endif
+# endif
+# endif
+ ']','\0'};
+#endif
+
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the