cxx features: add check for nullptr
This commit is contained in:
parent
a7a9239096
commit
b4b73f56a2
|
@ -32,6 +32,7 @@ function(cm_check_cxx_feature name)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
if(CMAKE_CXX_STANDARD)
|
if(CMAKE_CXX_STANDARD)
|
||||||
|
cm_check_cxx_feature(nullptr)
|
||||||
cm_check_cxx_feature(override)
|
cm_check_cxx_feature(override)
|
||||||
cm_check_cxx_feature(unordered_map)
|
cm_check_cxx_feature(unordered_map)
|
||||||
cm_check_cxx_feature(unordered_set)
|
cm_check_cxx_feature(unordered_set)
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
int test(int)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test(int*)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return test(nullptr);
|
||||||
|
}
|
|
@ -29,12 +29,19 @@
|
||||||
#cmakedefine CMAKE_USE_ELF_PARSER
|
#cmakedefine CMAKE_USE_ELF_PARSER
|
||||||
#cmakedefine CMAKE_USE_MACH_PARSER
|
#cmakedefine CMAKE_USE_MACH_PARSER
|
||||||
#cmakedefine CMAKE_ENCODING_UTF8
|
#cmakedefine CMAKE_ENCODING_UTF8
|
||||||
|
#cmakedefine CMake_HAVE_CXX_NULLPTR
|
||||||
#cmakedefine CMake_HAVE_CXX_OVERRIDE
|
#cmakedefine CMake_HAVE_CXX_OVERRIDE
|
||||||
#cmakedefine CMake_HAVE_CXX_UNORDERED_MAP
|
#cmakedefine CMake_HAVE_CXX_UNORDERED_MAP
|
||||||
#cmakedefine CMake_HAVE_CXX_UNORDERED_SET
|
#cmakedefine CMake_HAVE_CXX_UNORDERED_SET
|
||||||
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
|
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
|
||||||
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
|
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
|
||||||
|
|
||||||
|
#ifdef CMake_HAVE_CXX_NULLPTR
|
||||||
|
#define CM_NULLPTR nullptr
|
||||||
|
#else
|
||||||
|
#define CM_NULLPTR 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CMake_HAVE_CXX_OVERRIDE
|
#ifdef CMake_HAVE_CXX_OVERRIDE
|
||||||
#define CM_OVERRIDE override
|
#define CM_OVERRIDE override
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1272,6 +1272,7 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_
|
||||||
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
|
||||||
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
|
||||||
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
|
||||||
|
cmake_report cmConfigure.h${_tmp} "#define CM_NULLPTR 0"
|
||||||
cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE"
|
cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE"
|
||||||
|
|
||||||
# Regenerate configured headers
|
# Regenerate configured headers
|
||||||
|
|
Loading…
Reference in New Issue