mirror of
https://github.com/reactos/CMake.git
synced 2024-11-27 13:30:39 +00:00
Project: Add configurable name for version computation macros.
This commit is contained in:
parent
78acaafebe
commit
b70295760c
@ -125,6 +125,8 @@ function(compiler_id_detection outvar lang)
|
||||
endif()
|
||||
if (CID_VERSION_STRINGS)
|
||||
set(PREFIX ${CID_PREFIX})
|
||||
set(MACRO_DEC DEC)
|
||||
set(MACRO_HEX HEX)
|
||||
string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
|
||||
set(id_content "${id_content}${VERSION_BLOCK}\n")
|
||||
endif()
|
||||
|
@ -4,7 +4,7 @@ set(_compiler_id_pp_test "defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFI
|
||||
set(_compiler_id_version_compute "
|
||||
#if defined(__VISUALDSPVERSION__)
|
||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__VISUALDSPVERSION__>>24)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||
#endif")
|
||||
|
@ -4,4 +4,4 @@ set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
|
||||
|
||||
set(_compiler_id_version_compute "${_compiler_id_version_compute}
|
||||
# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__apple_build_version__)")
|
||||
# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__apple_build_version__)")
|
||||
|
@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__BORLANDC__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__BORLANDC__>>8)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__BORLANDC__ & 0xFF)")
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__clang_major__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__clang_minor__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
|
||||
# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
|
||||
# endif")
|
||||
|
||||
set(_compiler_id_simulate "
|
||||
|
@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__COMO__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __COMO_VERSION__ = VRR */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__COMO_VERSION__ / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__COMO_VERSION__ % 100)")
|
||||
|
@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__DECC)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __DECC_VER = VVRRTPPPP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__DECC_VER/10000000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__DECC_VER/100000 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__DECC_VER % 10000)")
|
||||
|
@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__DECCXX)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __DECCXX_VER = VVRRTPPPP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__DECCXX_VER/10000000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__DECCXX_VER/100000 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__DECCXX_VER % 10000)")
|
||||
|
@ -2,5 +2,5 @@
|
||||
set(_compiler_id_pp_test "defined(_CRAYC)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_RELEASE)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_RELEASE)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_RELEASE_MINOR)")
|
||||
|
@ -2,6 +2,6 @@
|
||||
set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__CODEGEARC_VERSION__ & 0xFFFF)")
|
||||
|
@ -2,8 +2,8 @@
|
||||
set(_compiler_id_pp_test "defined(__GNUC__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__GNUC__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__GNUC_MINOR__)
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__GNUC_PATCHLEVEL__)
|
||||
# endif")
|
||||
|
@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__HP_cc)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __HP_cc = VVRRPP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_cc % 100)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__HP_cc/10000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__HP_cc/100 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__HP_cc % 100)")
|
||||
|
@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__HP_aCC)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __HP_aCC = VVRRPP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__HP_aCC/10000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__HP_aCC/100 % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__HP_aCC % 100)")
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __IBMC__ = VRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMC__/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMC__/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMC__ % 10)")
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMCPP__/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMCPP__/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMCPP__ % 10)")
|
||||
|
@ -3,21 +3,21 @@ set(_compiler_id_pp_test "defined(__INTEL_COMPILER) || defined(__ICC)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __INTEL_COMPILER = VRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_COMPILER/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
|
||||
# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
|
||||
# endif")
|
||||
|
||||
set(_compiler_id_simulate "
|
||||
|
@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VE
|
||||
set(_compiler_id_version_compute "
|
||||
# if defined(_SGI_COMPILER_VERSION)
|
||||
/* _SGI_COMPILER_VERSION = VRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_SGI_COMPILER_VERSION/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_SGI_COMPILER_VERSION/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_SGI_COMPILER_VERSION % 10)
|
||||
# else
|
||||
/* _COMPILER_VERSION = VRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_COMPILER_VERSION/100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_COMPILER_VERSION/10 % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_COMPILER_VERSION % 10)
|
||||
# endif")
|
||||
|
@ -3,17 +3,17 @@ set(_compiler_id_pp_test "defined(_MSC_VER)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* _MSC_VER = VVRR */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define @PREFIX@COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(_MSC_BUILD)
|
||||
# endif")
|
||||
|
@ -3,8 +3,8 @@ set(_compiler_id_pp_test "defined(__WATCOMC__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__WATCOMC__ - 1100) / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__WATCOMC__ % 10)
|
||||
# endif")
|
||||
|
@ -2,8 +2,8 @@
|
||||
set(_compiler_id_pp_test "defined(__PGI)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__PGIC__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__PGIC_PATCHLEVEL__)
|
||||
# endif")
|
||||
|
@ -2,8 +2,8 @@
|
||||
set(_compiler_id_pp_test "defined(__PATHCC__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__PATHCC__)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__PATHCC_PATCHLEVEL__)
|
||||
# endif")
|
||||
|
@ -5,6 +5,6 @@ set(_compiler_id_pp_test "defined(SDCC)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* SDCC = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)")
|
||||
# define COMPILER_VERSION_MAJOR @MACRO_DEC@(SDCC/100)
|
||||
# define COMPILER_VERSION_MINOR @MACRO_DEC@(SDCC/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC % 10)")
|
||||
|
@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(__SUNPRO_C)")
|
||||
set(_compiler_id_version_compute "
|
||||
# if __SUNPRO_C >= 0x5100
|
||||
/* __SUNPRO_C = 0xVRRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_C>>12)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_C>>4 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_C & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_C>>8)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_C>>4 & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_C & 0xF)
|
||||
# endif")
|
||||
|
@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(__SUNPRO_CC)")
|
||||
set(_compiler_id_version_compute "
|
||||
# if __SUNPRO_CC >= 0x5100
|
||||
/* __SUNPRO_CC = 0xVRRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_CC>>12)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_CC>>4 & 0xFF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_CC & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_CC>>8)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_CC>>4 & 0xF)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_CC & 0xF)
|
||||
# endif")
|
||||
|
@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__TI_COMPILER_VERSION__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)")
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__TI_COMPILER_VERSION__/1000000)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__TI_COMPILER_VERSION__ % 1000)")
|
||||
|
@ -3,8 +3,8 @@ set(_compiler_id_pp_test "defined(__WATCOMC__) && __WATCOMC__ < 1200")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__WATCOMC__ / 100)
|
||||
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__WATCOMC__ % 10)
|
||||
# endif")
|
||||
|
Loading…
Reference in New Issue
Block a user