Embedded Template Library 1.0
determine_compiler_version.h
Go to the documentation of this file.
1
2
3/******************************************************************************
4The MIT License(MIT)
5
6Embedded Template Library.
7https://github.com/ETLCPP/etl
8https://www.etlcpp.com
9
10Copyright(c) 2019 John Wellbelove
11
12Permission is hereby granted, free of charge, to any person obtaining a copy
13of this software and associated documentation files(the "Software"), to deal
14in the Software without restriction, including without limitation the rights
15to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16copies of the Software, and to permit persons to whom the Software is
17furnished to do so, subject to the following conditions :
18
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21
22THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28SOFTWARE.
29******************************************************************************/
30
31#ifndef ETL_DETERMINE_COMPILER_VERSION_H_INCLUDED
32#define ETL_DETERMINE_COMPILER_VERSION_H_INCLUDED
33
34#include "determine_compiler.h"
35
36#if !defined(ETL_COMPILER_VERSION) && !defined(ETL_COMPILER_FULL_VERSION)
37 #if defined(ETL_COMPILER_GCC)
38 #define ETL_COMPILER_VERSION __GNUC__
39 #define ETL_COMPILER_FULL_VERSION ((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__)
40 #elif defined(ETL_COMPILER_MICROSOFT)
41 #define ETL_COMPILER_VERSION _MSC_VER
42 #define ETL_COMPILER_FULL_VERSION _MSC_FULL_VER
43 #elif defined(ETL_COMPILER_ARM5)
44 #define ETL_COMPILER_VERSION __ARMCC_VERSION
45 #define ETL_COMPILER_FULL_VERSION __ARMCC_VERSION
46 #elif defined(ETL_COMPILER_ARM6)
47 #define ETL_COMPILER_VERSION __ARMCOMPILER_VERSION
48 #define ETL_COMPILER_FULL_VERSION __ARMCOMPILER_VERSION
49 #elif defined(ETL_COMPILER_ARM7)
50 #define ETL_COMPILER_VERSION __ARMCOMPILER_VERSION
51 #define ETL_COMPILER_FULL_VERSION __ARMCOMPILER_VERSION
52 #elif defined(ETL_COMPILER_CLANG)
53 #define ETL_COMPILER_VERSION __clang_version__
54 #define ETL_COMPILER_FULL_VERSION ((__clang_major__ * 10000) + (__clang_minor__ * 100) + __clang_patchlevel__)
55 #elif defined(ETL_COMPILER_GREEN_HILLS)
56 #define ETL_COMPILER_VERSION __GHS_VERSION_NUMBER__
57 #define ETL_COMPILER_FULL_VERSION __GHS_VERSION_NUMBER__
58 #elif defined(ETL_COMPILER_IAR)
59 #define ETL_COMPILER_VERSION __VER__
60 #define ETL_COMPILER_FULL_VERSION __VER__
61 #elif defined(ETL_COMPILER_INTEL)
62 #define ETL_COMPILER_VERSION __INTEL_COMPILER
63 #define ETL_COMPILER_FULL_VERSION __INTEL_COMPILER
64 #elif defined(ETL_COMPILER_TEXAS_INSTRUMENTS)
65 #define ETL_COMPILER_VERSION __TI_COMPILER_VERSION__
66 #define ETL_COMPILER_FULL_VERSION __TI_COMPILER_VERSION__
67 #elif defined(ETL_COMPILER_TASKING)
68 #define ETL_COMPILER_VERSION __REVISION__
69 #define ETL_COMPILER_FULL_VERSION __VERSION__
70 #else
71 #define ETL_COMPILER_VERSION 0
72 #define ETL_COMPILER_FULL_VERSION 0
73 #endif
74#endif
75
76#endif