Go to the documentation of this file.
23 #ifndef STDEXT_COMPILER_H
24 #define STDEXT_COMPILER_H
32 #define BUILD_COMPILER "clang " __VERSION__
33 #elif defined(__GNUC__)
34 #if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
35 #error "Sorry, you need gcc 4.6 or greater to compile."
37 #define BUILD_COMPILER "gcc " __VERSION__
38 #elif defined(_MSC_VER)
40 #error "You need Visual Studio 2013 or greater to compile."
42 #pragma warning(disable:4244) // conversion from 'A' to 'B', possible loss of data
43 #pragma warning(disable:4267) // '?' : conversion from 'A' to 'B', possible loss of data
44 #pragma warning(disable:4305) // 'initializing' : truncation from 'A' to 'B'
45 #pragma warning(disable:4146) // unary minus operator applied to unsigned type, result still unsigned
46 #pragma warning(disable:4800) // 'A' : forcing value to bool 'true' or 'false' (performance warning)
48 #if _MSC_VER == 1912 || _MSC_VER == 1911 || _MSC_VER == 1910
49 #define BUILD_COMPILER "Visual Studio 2017"
50 #elif _MSC_VER == 1900
51 #define BUILD_COMPILER "Visual Studio 2015"
52 #elif _MSC_VER == 1800
53 #define BUILD_COMPILER "Visual Studio 2013"
55 #define BUILD_COMPILER "Visual Studio"
58 #define __PRETTY_FUNCTION__ __FUNCDNAME__
60 #error "Compiler not supported."
66 #if defined(__clang__) || defined(__GNUC__)
67 #define likely(x) __builtin_expect(!!(x), 1)
68 #define unlikely(x) __builtin_expect(!!(x), 0)
71 #define unlikely(x) (x)
74 #if !defined(_MSC_VER) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
75 #error "C++0x is required to compile this application. Try updating your compiler."