nullptr compatibility: special detection for clang

This commit is contained in:
Sébastien Rombauts 2017-12-13 17:18:21 +01:00
parent ae1703f1ce
commit 5ed4a1ab79
2 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,7 @@ else (MSVC)
set(CPPLINT_ARG_OUTPUT "--output=eclipse") set(CPPLINT_ARG_OUTPUT "--output=eclipse")
set(CPPCHECK_ARG_TEMPLATE "--template=gcc") set(CPPCHECK_ARG_TEMPLATE "--template=gcc")
# Useful compile flags and extra warnings # Useful compile flags and extra warnings
add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline -Wno-c++0x-compat)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
# GCC flags # GCC flags
if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX) if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX)

View File

@ -30,7 +30,8 @@
#define nullptr NULL #define nullptr NULL
#endif // nullptr #endif // nullptr
#endif // _MSC_VER < 1600 #endif // _MSC_VER < 1600
#else // _MSC_VER #elif defined(__clang__) && __has_feature(cxx_nullptr) // Clang 3.0+
#else // GCC or older Clang
#if (__cplusplus < 201103L) && !defined(__GXX_EXPERIMENTAL_CXX0X__) // before C++11 on GCC4.7 and Visual Studio 2010 #if (__cplusplus < 201103L) && !defined(__GXX_EXPERIMENTAL_CXX0X__) // before C++11 on GCC4.7 and Visual Studio 2010
#ifndef HAVE_NULLPTR #ifndef HAVE_NULLPTR
#define HAVE_NULLPTR ///< A macro to avoid double definition of nullptr #define HAVE_NULLPTR ///< A macro to avoid double definition of nullptr