From fa613e393f96ef7de246a418761af72f36a0c390 Mon Sep 17 00:00:00 2001 From: Rong Mantle Bao Date: Sun, 10 Jul 2022 17:34:07 +0800 Subject: [PATCH] Read CV_CXX11 for C++11 detection --- modules/core/src/system.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index dda62fb..3b68771 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -301,14 +301,7 @@ DECLARE_CV_CPUID_X86 #endif #endif - -#if ((__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1800)) - #define HAVE_CXX11 1 -#else - #define HAVE_CXX11 0 -#endif - -#if HAVE_CXX11 +#if defined CV_CXX11 #include #endif @@ -850,7 +843,7 @@ bool useOptimized(void) int64 getTickCount(void) { -#if HAVE_CXX11 +#if defined CV_CXX11 std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); return (int64)now.time_since_epoch().count(); #elif defined _WIN32 || defined WINCE @@ -872,7 +865,7 @@ int64 getTickCount(void) double getTickFrequency(void) { -#if HAVE_CXX11 +#if defined CV_CXX11 using clock_period_t = std::chrono::steady_clock::duration::period; double clock_freq = clock_period_t::den / clock_period_t::num; return clock_freq; -- 2.7.4