Read CV_CXX11 for C++11 detection
authorRong Mantle Bao <baorong2005@126.com>
Sun, 10 Jul 2022 09:34:07 +0000 (17:34 +0800)
committerRong Mantle Bao <baorong2005@126.com>
Sun, 10 Jul 2022 11:21:17 +0000 (19:21 +0800)
modules/core/src/system.cpp

index dda62fb89ed9fe8f9d322085b23ccbe35964d23a..3b6877105dc3c81c4c72acecbb540e35d19de447 100644 (file)
@@ -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 <chrono>
 #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;