From 86985dfd1ff2b89c751c761e345039899432c2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Wed, 13 Dec 2017 20:33:36 +0100 Subject: [PATCH] Fix nullptr detection with AppleClang --- .travis.yml | 2 +- CMakeLists.txt | 2 +- include/SQLiteCpp/Utils.h | 1 + src/Database.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e5fe13..b7ff3d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2016 Sebastien Rombauts (sebastien.rombauts@gmail.com) +# Copyright (c) 2012-2017 Sebastien Rombauts (sebastien.rombauts@gmail.com) # request for Ubuntu 14.04 Trusty VM sudo: true diff --git a/CMakeLists.txt b/CMakeLists.txt index f8b58e8..15aff3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ set(SQLITECPP_INC ${PROJECT_SOURCE_DIR}/include/SQLiteCpp/Utils.h ${PROJECT_SOURCE_DIR}/include/SQLiteCpp/VariadicBind.h ) -source_group(inc FILES ${SQLITECPP_INC}) +source_group(include FILES ${SQLITECPP_INC}) # list of test files of the library set(SQLITECPP_TESTS diff --git a/include/SQLiteCpp/Utils.h b/include/SQLiteCpp/Utils.h index 83fffaa..7f05de4 100644 --- a/include/SQLiteCpp/Utils.h +++ b/include/SQLiteCpp/Utils.h @@ -30,6 +30,7 @@ #define nullptr NULL #endif // nullptr #endif // _MSC_VER < 1600 +#elif defined(__APPLE__) // AppleClang #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 diff --git a/src/Database.cpp b/src/Database.cpp index c230210..2f87d16 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -217,7 +217,7 @@ void Database::loadExtension(const char* apExtensionName, const char *apEntryPoi throw std::runtime_error("sqlite extensions are disabled"); #else -#ifdef SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION // Since SQLite 3.13 (2017-05-18): +#ifdef SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION // Since SQLite 3.13 (2016-05-18): // Security warning: // It is recommended that the SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION method be used to enable only this interface. // The use of the sqlite3_enable_load_extension() interface should be avoided to keep the SQL load_extension()