diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index e2177c4b..9fd790a8 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -11,6 +11,7 @@ #pragma once #include +#include #include @@ -95,7 +96,7 @@ class Database Database(const char* apFilename, const int aFlags = SQLite::OPEN_READONLY, const int aBusyTimeoutMs = 0, - const char* apVfs = NULL); + const char* apVfs = COMPABILITY_NULLPTR); /** * @brief Open the provided database UTF-8 filename. diff --git a/include/SQLiteCpp/compability_macros.h b/include/SQLiteCpp/compability_macros.h new file mode 100644 index 00000000..dadf726e --- /dev/null +++ b/include/SQLiteCpp/compability_macros.h @@ -0,0 +1,249 @@ +// Generated by CMake 3.9.6 using the following commands: +// include(WriteCompilerDetectionHeader) +// write_compiler_detection_header( +// FILE "${CMAKE_CURRENT_BINARY_DIR}/compability_macros.h" +// PREFIX COMPABILITY +// COMPILERS GNU Clang MSVC Intel +// FEATURES cxx_nullptr +// ALLOW_UNKNOWN_COMPILERS +// ALLOW_UNKNOWN_COMPILER_VERSIONS +// ) + +// This is a generated file. Do not edit! + +#ifndef COMPABILITY_COMPILER_DETECTION_H +#define COMPABILITY_COMPILER_DETECTION_H + +#ifdef __cplusplus +# define COMPABILITY_COMPILER_IS_Comeau 0 +# define COMPABILITY_COMPILER_IS_Intel 0 +# define COMPABILITY_COMPILER_IS_PathScale 0 +# define COMPABILITY_COMPILER_IS_Embarcadero 0 +# define COMPABILITY_COMPILER_IS_Borland 0 +# define COMPABILITY_COMPILER_IS_Watcom 0 +# define COMPABILITY_COMPILER_IS_OpenWatcom 0 +# define COMPABILITY_COMPILER_IS_SunPro 0 +# define COMPABILITY_COMPILER_IS_HP 0 +# define COMPABILITY_COMPILER_IS_Compaq 0 +# define COMPABILITY_COMPILER_IS_zOS 0 +# define COMPABILITY_COMPILER_IS_XL 0 +# define COMPABILITY_COMPILER_IS_VisualAge 0 +# define COMPABILITY_COMPILER_IS_PGI 0 +# define COMPABILITY_COMPILER_IS_Cray 0 +# define COMPABILITY_COMPILER_IS_TI 0 +# define COMPABILITY_COMPILER_IS_Fujitsu 0 +# define COMPABILITY_COMPILER_IS_SCO 0 +# define COMPABILITY_COMPILER_IS_AppleClang 0 +# define COMPABILITY_COMPILER_IS_Clang 0 +# define COMPABILITY_COMPILER_IS_GNU 0 +# define COMPABILITY_COMPILER_IS_MSVC 0 +# define COMPABILITY_COMPILER_IS_ADSP 0 +# define COMPABILITY_COMPILER_IS_IAR 0 +# define COMPABILITY_COMPILER_IS_ARMCC 0 +# define COMPABILITY_COMPILER_IS_MIPSpro 0 + +#if defined(__COMO__) +# undef COMPABILITY_COMPILER_IS_Comeau +# define COMPABILITY_COMPILER_IS_Comeau 1 + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# undef COMPABILITY_COMPILER_IS_Intel +# define COMPABILITY_COMPILER_IS_Intel 1 + +#elif defined(__PATHCC__) +# undef COMPABILITY_COMPILER_IS_PathScale +# define COMPABILITY_COMPILER_IS_PathScale 1 + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# undef COMPABILITY_COMPILER_IS_Embarcadero +# define COMPABILITY_COMPILER_IS_Embarcadero 1 + +#elif defined(__BORLANDC__) +# undef COMPABILITY_COMPILER_IS_Borland +# define COMPABILITY_COMPILER_IS_Borland 1 + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# undef COMPABILITY_COMPILER_IS_Watcom +# define COMPABILITY_COMPILER_IS_Watcom 1 + +#elif defined(__WATCOMC__) +# undef COMPABILITY_COMPILER_IS_OpenWatcom +# define COMPABILITY_COMPILER_IS_OpenWatcom 1 + +#elif defined(__SUNPRO_CC) +# undef COMPABILITY_COMPILER_IS_SunPro +# define COMPABILITY_COMPILER_IS_SunPro 1 + +#elif defined(__HP_aCC) +# undef COMPABILITY_COMPILER_IS_HP +# define COMPABILITY_COMPILER_IS_HP 1 + +#elif defined(__DECCXX) +# undef COMPABILITY_COMPILER_IS_Compaq +# define COMPABILITY_COMPILER_IS_Compaq 1 + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# undef COMPABILITY_COMPILER_IS_zOS +# define COMPABILITY_COMPILER_IS_zOS 1 + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# undef COMPABILITY_COMPILER_IS_XL +# define COMPABILITY_COMPILER_IS_XL 1 + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# undef COMPABILITY_COMPILER_IS_VisualAge +# define COMPABILITY_COMPILER_IS_VisualAge 1 + +#elif defined(__PGI) +# undef COMPABILITY_COMPILER_IS_PGI +# define COMPABILITY_COMPILER_IS_PGI 1 + +#elif defined(_CRAYC) +# undef COMPABILITY_COMPILER_IS_Cray +# define COMPABILITY_COMPILER_IS_Cray 1 + +#elif defined(__TI_COMPILER_VERSION__) +# undef COMPABILITY_COMPILER_IS_TI +# define COMPABILITY_COMPILER_IS_TI 1 + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# undef COMPABILITY_COMPILER_IS_Fujitsu +# define COMPABILITY_COMPILER_IS_Fujitsu 1 + +#elif defined(__SCO_VERSION__) +# undef COMPABILITY_COMPILER_IS_SCO +# define COMPABILITY_COMPILER_IS_SCO 1 + +#elif defined(__clang__) && defined(__apple_build_version__) +# undef COMPABILITY_COMPILER_IS_AppleClang +# define COMPABILITY_COMPILER_IS_AppleClang 1 + +#elif defined(__clang__) +# undef COMPABILITY_COMPILER_IS_Clang +# define COMPABILITY_COMPILER_IS_Clang 1 + +#elif defined(__GNUC__) || defined(__GNUG__) +# undef COMPABILITY_COMPILER_IS_GNU +# define COMPABILITY_COMPILER_IS_GNU 1 + +#elif defined(_MSC_VER) +# undef COMPABILITY_COMPILER_IS_MSVC +# define COMPABILITY_COMPILER_IS_MSVC 1 + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# undef COMPABILITY_COMPILER_IS_ADSP +# define COMPABILITY_COMPILER_IS_ADSP 1 + +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# undef COMPABILITY_COMPILER_IS_IAR +# define COMPABILITY_COMPILER_IS_IAR 1 + +#elif defined(__ARMCC_VERSION) +# undef COMPABILITY_COMPILER_IS_ARMCC +# define COMPABILITY_COMPILER_IS_ARMCC 1 + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# undef COMPABILITY_COMPILER_IS_MIPSpro +# define COMPABILITY_COMPILER_IS_MIPSpro 1 + + +#endif + +# if COMPABILITY_COMPILER_IS_GNU + +# if defined(__GNUC__) +# define COMPABILITY_COMPILER_VERSION_MAJOR (__GNUC__) +# else +# define COMPABILITY_COMPILER_VERSION_MAJOR (__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPABILITY_COMPILER_VERSION_MINOR (__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPABILITY_COMPILER_VERSION_PATCH (__GNUC_PATCHLEVEL__) +# endif + +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) +# define COMPABILITY_COMPILER_CXX_NULLPTR 1 +# else +# define COMPABILITY_COMPILER_CXX_NULLPTR 0 +# endif + +# elif COMPABILITY_COMPILER_IS_Clang + +# define COMPABILITY_COMPILER_VERSION_MAJOR (__clang_major__) +# define COMPABILITY_COMPILER_VERSION_MINOR (__clang_minor__) +# define COMPABILITY_COMPILER_VERSION_PATCH (__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define COMPABILITY_SIMULATE_VERSION_MAJOR (_MSC_VER / 100) +# define COMPABILITY_SIMULATE_VERSION_MINOR (_MSC_VER % 100) +# endif + +# if ((__clang_major__ * 100) + __clang_minor__) >= 301 && __has_feature(cxx_nullptr) +# define COMPABILITY_COMPILER_CXX_NULLPTR 1 +# else +# define COMPABILITY_COMPILER_CXX_NULLPTR 0 +# endif + +# elif COMPABILITY_COMPILER_IS_MSVC + + /* _MSC_VER = VVRR */ +# define COMPABILITY_COMPILER_VERSION_MAJOR (_MSC_VER / 100) +# define COMPABILITY_COMPILER_VERSION_MINOR (_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPABILITY_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPABILITY_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPABILITY_COMPILER_VERSION_TWEAK (_MSC_BUILD) +# endif + +# if _MSC_VER >= 1600 +# define COMPABILITY_COMPILER_CXX_NULLPTR 1 +# else +# define COMPABILITY_COMPILER_CXX_NULLPTR 0 +# endif + +# elif COMPABILITY_COMPILER_IS_Intel + + /* __INTEL_COMPILER = VRP */ +# define COMPABILITY_COMPILER_VERSION_MAJOR (__INTEL_COMPILER/100) +# define COMPABILITY_COMPILER_VERSION_MINOR (__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPABILITY_COMPILER_VERSION_PATCH (__INTEL_COMPILER_UPDATE) +# else +# define COMPABILITY_COMPILER_VERSION_PATCH (__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPABILITY_COMPILER_VERSION_TWEAK (__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define COMPABILITY_SIMULATE_VERSION_MAJOR (_MSC_VER / 100) +# define COMPABILITY_SIMULATE_VERSION_MINOR (_MSC_VER % 100) +# endif + +# if __INTEL_COMPILER >= 1210 && ((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) || defined(__GXX_EXPERIMENTAL_CXX0X__)) +# define COMPABILITY_COMPILER_CXX_NULLPTR 1 +# else +# define COMPABILITY_COMPILER_CXX_NULLPTR 0 +# endif + +# endif + +# if defined(COMPABILITY_COMPILER_CXX_NULLPTR) && COMPABILITY_COMPILER_CXX_NULLPTR +# define COMPABILITY_NULLPTR nullptr +# else +# define COMPABILITY_NULLPTR 0 +# endif + +#endif + +#endif