From b03f2286a8ff16e97716d8b2c3fb46b489980d95 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Aug 2016 11:56:03 +0200 Subject: Reorganize config files Split config.h inclusion and C++11 tests. Move VC C++11 to config.hxx. --- odb/details/config-vc.h | 20 -------------------- odb/details/config.hxx | 42 +++++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 37 deletions(-) diff --git a/odb/details/config-vc.h b/odb/details/config-vc.h index c187fe5..3aced8f 100644 --- a/odb/details/config-vc.h +++ b/odb/details/config-vc.h @@ -11,24 +11,4 @@ #define ODB_THREADS_WIN32 #define ODB_THREADS_TLS_DECLSPEC -/* VC++10 and later have C++11 always enabled. - */ -#if _MSC_VER >= 1600 -# define ODB_CXX11 -# define ODB_CXX11_NULLPTR -# if _MSC_VER >= 1700 -# define ODB_CXX11_ENUM -# if _MSC_VER >= 1800 -# define ODB_CXX11_DELETED_FUNCTION -# define ODB_CXX11_EXPLICIT_CONVERSION_OPERATOR -# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT -# define ODB_CXX11_VARIADIC_TEMPLATE -# define ODB_CXX11_INITIALIZER_LIST -# if _MSC_VER >= 1900 -# define ODB_CXX11_NOEXCEPT -# endif -# endif -# endif -#endif - #endif /* ODB_DETAILS_CONFIG_VC_H */ diff --git a/odb/details/config.hxx b/odb/details/config.hxx index 5aa35aa..b240f5c 100644 --- a/odb/details/config.hxx +++ b/odb/details/config.hxx @@ -7,25 +7,36 @@ // no pre -#ifdef _MSC_VER -# include -#elif defined(ODB_COMPILER) +#ifdef ODB_COMPILER # define ODB_THREADS_NONE # define LIBODB_STATIC_LIB -# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +#elif defined(_MSC_VER) +# include +#else +# include +#endif + +// C++11 support. +// +#ifdef _MSC_VER +# if _MSC_VER >= 1600 // VC++10 and later have C++11 always enabled. # define ODB_CXX11 -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4 -# define ODB_CXX11_NULLPTR -# define ODB_CXX11_NOEXCEPT +# define ODB_CXX11_NULLPTR +# if _MSC_VER >= 1700 +# define ODB_CXX11_ENUM +# if _MSC_VER >= 1800 +# define ODB_CXX11_DELETED_FUNCTION +# define ODB_CXX11_EXPLICIT_CONVERSION_OPERATOR +# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT +# define ODB_CXX11_VARIADIC_TEMPLATE +# define ODB_CXX11_INITIALIZER_LIST +# if _MSC_VER >= 1900 +# define ODB_CXX11_NOEXCEPT +# endif +# endif # endif -# define ODB_CXX11_DELETED_FUNCTION -# define ODB_CXX11_EXPLICIT_CONVERSION_OPERATOR -# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT -# define ODB_CXX11_VARIADIC_TEMPLATE -# define ODB_CXX11_INITIALIZER_LIST # endif #else -# include # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L # define ODB_CXX11 # ifdef __clang__ // Pretends to be a really old __GNUC__ on some platforms. @@ -45,10 +56,7 @@ # define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT # define ODB_CXX11_VARIADIC_TEMPLATE # define ODB_CXX11_INITIALIZER_LIST -// GCC supports strongly typed enums from 4.4 (forward -- 4.6), -// Clang -- 2.9 (3.1). -// -# define ODB_CXX11_ENUM +# define ODB_CXX11_ENUM // GCC 4.4 (forward -- 4.6), Clang 2.9 (3.1). # endif #endif -- cgit v1.1