Visual Studio 2013 Compatibility

This commit is contained in:
dalkon
2013-11-12 13:47:53 +01:00
committed by Eduardo Bart
parent d3e97d33c7
commit c9597d6682
11 changed files with 67 additions and 18 deletions

View File

@@ -25,10 +25,23 @@
#ifdef __clang__
// clang is supported
#define BUILD_COMPILER "clang " __VERSION__
#elif defined(__GNUC__)
#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#error "Sorry, you need gcc 4.6 or greater to compile."
#endif
#define BUILD_COMPILER "gcc " __VERSION__
#elif defined(_MSC_VER)
#if _MSC_VER < 1800
#error "You need Visual Studio 2013 or greater to compile."
#endif
#pragma warning(disable:4244) // conversion from 'A' to 'B', possible loss of data
#pragma warning(disable:4305) // 'initializing' : truncation from 'A' to 'B'
#pragma warning(disable:4146) // unary minus operator applied to unsigned type, result still unsigned
#pragma warning(disable:4800) // 'A' : forcing value to bool 'true' or 'false' (performance warning)
#define BUILD_COMPILER "msvc12"
#define __PRETTY_FUNCTION__ __FUNCDNAME__
#else
#error "Compiler not supported."
#endif
@@ -44,12 +57,8 @@
#define unlikely(x) (x)
#endif
#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
#if !defined(_MSC_VER) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
#error "C++0x is required to compile this application. Try updating your compiler."
#endif
#ifdef _MSC_VER
#warning "MSVC lacks some C++11 features used in this application; compilation is most likely to fail."
#endif
#endif