1 ///////////////////////////////////////////////////////////////////////////////
2 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 // http://www.gnu.org/licenses/lgpl-2.1.txt
20 //////////////////////////////////////////////////////////////////////////////////
25 #include <MUtils/Global.h>
38 MUTILS_API static const QDate build_date(const char *const date_str = build_date_raw());
41 MUTILS_API static const QTime build_time(const char *const time_str = build_time_raw());
44 MUTILS_API static const char *const compiler_version(void)
46 #if defined(__INTEL_COMPILER)
47 #if (__INTEL_COMPILER >= 1500)
48 static const char *const COMPILER_VERS = "ICL 15." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
49 #elif (__INTEL_COMPILER >= 1400)
50 static const char *const COMPILER_VERS = "ICL 14." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
51 #elif (__INTEL_COMPILER >= 1300)
52 static const char *const COMPILER_VERS = "ICL 13." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
53 #elif (__INTEL_COMPILER >= 1200)
54 static const char *const COMPILER_VERS = "ICL 12." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
55 #elif (__INTEL_COMPILER >= 1100)
56 static const char *const COMPILER_VERS = "ICL 11.x";
57 #elif (__INTEL_COMPILER >= 1000)
58 static const char *const COMPILER_VERS = "ICL 10.x";
60 #error Compiler is not supported!
62 #elif defined(_MSC_VER)
63 #if (_MSC_VER == 1800)
64 #if (_MSC_FULL_VER == 180021005)
65 static const char *const COMPILER_VERS = "MSVC 2013";
66 #elif (_MSC_FULL_VER == 180030501)
67 static const char *const COMPILER_VERS = "MSVC 2013.2";
68 #elif (_MSC_FULL_VER == 180030723)
69 static const char *const COMPILER_VERS = "MSVC 2013.3";
70 #elif (_MSC_FULL_VER == 180031101)
71 static const char *const COMPILER_VERS = "MSVC 2013.4";
73 #error Compiler version is not supported yet!
75 #elif (_MSC_VER == 1700)
76 #if (_MSC_FULL_VER == 170050727)
77 static const char *const COMPILER_VERS = "MSVC 2012";
78 #elif (_MSC_FULL_VER == 170051106)
79 static const char *const COMPILER_VERS = "MSVC 2012.1";
80 #elif (_MSC_FULL_VER == 170060315)
81 static const char *const COMPILER_VERS = "MSVC 2012.2";
82 #elif (_MSC_FULL_VER == 170060610)
83 static const char *const COMPILER_VERS = "MSVC 2012.3";
84 #elif (_MSC_FULL_VER == 170061030)
85 static const char *const COMPILER_VERS = "MSVC 2012.4";
87 #error Compiler version is not supported yet!
89 #elif (_MSC_VER == 1600)
90 #if (_MSC_FULL_VER >= 160040219)
91 static const char *const COMPILER_VERS = "MSVC 2010-SP1";
93 static const char *const COMPILER_VERS = "MSVC 2010";
95 #elif (_MSC_VER == 1500)
96 #if (_MSC_FULL_VER >= 150030729)
97 static const char *const COMPILER_VERS = "MSVC 2008-SP1";
99 static const char *const COMPILER_VERS = "MSVC 2008";
102 #error Compiler is not supported!
105 #error Compiler is not supported!
108 return COMPILER_VERS;
111 //Architecture detection
112 MUTILS_API static const char *const compiler_arch(void)
115 static const char *const COMPILER_ARCH = "x64";
116 #elif defined(_M_IX86)
117 static const char *const COMPILER_ARCH = "x86";
119 #error Architecture is not supported!
122 return COMPILER_ARCH;
127 static const char *const build_date_raw(void)
129 static const char *const RAW_BUILD_DATE = __DATE__;
130 return RAW_BUILD_DATE;
134 static const char *const build_time_raw(void)
136 static const char *const RAW_BUILD_TIME = __TIME__;
137 return RAW_BUILD_TIME;
140 //Disable construction
141 Version(void) { throw 666; }
142 Version(const Version&) { throw 666; }
146 ///////////////////////////////////////////////////////////////////////////////