From 5c0c4501b3991ad3ef71f7c4249e00fb5f74010b Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 18 Sep 2014 15:42:13 +0400 Subject: [PATCH] modify MSVC++ property file --- cds/compiler/vc/defs.h | 92 ++++++++++-------------------------------- 1 file changed, 21 insertions(+), 71 deletions(-) diff --git a/cds/compiler/vc/defs.h b/cds/compiler/vc/defs.h index e24d30dd..103d9fe8 100644 --- a/cds/compiler/vc/defs.h +++ b/cds/compiler/vc/defs.h @@ -8,23 +8,15 @@ #define CDS_COMPILER_VERSION _MSC_VER // Compiler name -// Supported compilers: MS VC 2008, 2010, 2012, 2013 +// Supported compilers: MS VC 2013 // C++ compiler versions: -#define CDS_COMPILER_MSVC9 1500 // 2008 vc9 -#define CDS_COMPILER_MSVC10 1600 // 2010 vc10 -#define CDS_COMPILER_MSVC11 1700 // 2012 vc11 #define CDS_COMPILER_MSVC12 1800 // 2013 vc12 -#if _MSC_VER == 1500 -# define CDS_COMPILER__NAME "MS Visual C++ 2008" -# define CDS_COMPILER__NICK "vc9" -#elif _MSC_VER == 1600 -# define CDS_COMPILER__NAME "MS Visual C++ 2010" -# define CDS_COMPILER__NICK "vc10" -#elif _MSC_VER == 1700 -# define CDS_COMPILER__NAME "MS Visual C++ 2012" -# define CDS_COMPILER__NICK "vc11" -#elif _MSC_VER == 1800 +#if CDS_COMPILER_VERSION < CDS_COMPILER_MSVC12 +# error "Only MS Visual C++ 12 (2013) and above is supported" +#endif + +#if _MSC_VER == 1800 # define CDS_COMPILER__NAME "MS Visual C++ 2013" # define CDS_COMPILER__NICK "vc12" #else @@ -64,7 +56,6 @@ # error Microsoft Visual C++ compiler is supported for x86 only #endif - #define __attribute__( _x ) #define CDS_STDCALL __stdcall @@ -77,11 +68,6 @@ #define alignof __alignof -#if CDS_COMPILER_VERSION < 1600 -# include -# define static_assert(_expr, _msg) BOOST_STATIC_ASSERT((_expr)) -#endif - // Memory leaks detection (debug build only) #ifdef _DEBUG # define _CRTDBG_MAP_ALLOC @@ -102,78 +88,44 @@ #define CDS_NOEXCEPT_SUPPORT_(expr) // C++11 atomic support -// MSVC 2012 has implementation but all load/store is based on CAS -// that is quite inefficient. -// So for VC 2012 we use internal implementation for atomics -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_ATOMIC_SUPPORT 1 -#endif - +#define CDS_CXX11_ATOMIC_SUPPORT 1 // Lambda (VC 10 +) -#if CDS_COMPILER_VERSION >= 1600 -# define CDS_CXX11_LAMBDA_SUPPORT -# if CDS_COMPILER_VERSION < 1700 -# define CDS_BUG_STATIC_MEMBER_IN_LAMBDA -# endif -#endif +//#define CDS_CXX11_LAMBDA_SUPPORT // RValue (VC 10+) -#if CDS_COMPILER_VERSION >= 1600 -# define CDS_RVALUE_SUPPORT -# define CDS_MOVE_SEMANTICS_SUPPORT -#endif +#define CDS_RVALUE_SUPPORT +#define CDS_MOVE_SEMANTICS_SUPPORT // Default template arguments for function templates (VC12+) -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT -#endif +#define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT // C++11 delete definition ( function declaration = delete) -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_DELETE_DEFINITION_SUPPORT -#endif +#define CDS_CXX11_DELETE_DEFINITION_SUPPORT // C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]] -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT -#endif +#define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT // Variadic template support (VC12+) -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT 1 -#endif +#define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT 1 // C++11 template alias -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_TEMPLATE_ALIAS_SUPPORT -#endif +#define CDS_CXX11_TEMPLATE_ALIAS_SUPPORT // C++11 inline namespace //#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT // Explicit conversion operator (VC12+) -#if CDS_COMPILER_VERSION >= 1800 -# define CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT -#endif - +#define CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT // -#if CDS_COMPILER_VERSION == 1500 - // MS VC 2008 has no -# include -#else -# include -#endif +#include // Thread support library (thread, mutex, condition variable) -#if CDS_COMPILER_VERSION >= 1700 - // MS VC 11+ -# define CDS_CXX11_STDLIB_THREAD -# define CDS_CXX11_STDLIB_MUTEX -# define CDS_CXX11_STDLIB_CONDITION_VARIABLE -# define CDS_CXX11_STDLIB_CHRONO -#endif +#define CDS_CXX11_STDLIB_THREAD +#define CDS_CXX11_STDLIB_MUTEX +#define CDS_CXX11_STDLIB_CONDITION_VARIABLE +#define CDS_CXX11_STDLIB_CHRONO // Full SFINAE support //#if CDS_COMPILER_VERSION >= ???? @@ -184,8 +136,6 @@ // ************************************************* // Alignment macro -// VC 2005 generates error C2719 "formal parameter with __declspec(align('#')) won't be aligned" -// for function's formal parameter with align declspec #define CDS_TYPE_ALIGNMENT(n) __declspec( align(n) ) #define CDS_DATA_ALIGNMENT(n) __declspec( align(n) ) #define CDS_CLASS_ALIGNMENT(n) __declspec( align(n) ) -- 2.34.1