commit 1dd22bc13f4b7e4e1823fd4dd5e9772466be2b29
parent 56eabf23f7b7f2ceba57ece637f462b12de93a8c
Author: kinichiro <kinichiro.inoguchi@gmail.com>
Date: Wed, 1 Jul 2020 17:54:13 +0900
Check if OS has C++ std::complex, and use this condition to
include <complex> or not in globals.h, instead of checking OS macro
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -58,6 +58,7 @@ CHECK_CXX_SOURCE_COMPILES(
check_cxx_compiler_flag("-msse2" SUPPORT_SSE)
check_cxx_compiler_flag("-mfpu=neon -Werror" SUPPORT_NEON)
+check_include_file_cxx(complex HAVE_CPP_STD_COMPLEX)
set(CMAKE_REQUIRED_FLAGS "")
@@ -120,6 +121,10 @@ else()
add_definitions(-DHAVE_ASYNC=0)
endif()
+if(HAVE_CPP_STD_COMPLEX)
+ add_definitions(-DHAVE_CPP_STD_COMPLEX=1)
+endif()
+
if(DemoMode)
add_definitions(-DDEMO_VERSION=1)
endif()
diff --git a/src/globals.h b/src/globals.h
@@ -26,7 +26,7 @@
//Forward Declarations
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(HAVE_CPP_STD_COMPLEX)
#include <complex>
#else
namespace std {