fix VS Windows build with eigen. https://github.com/opencv/opencv/issues/17548
authorYuriy Obukh <Bleach665@gmail.com>
Thu, 18 Jun 2020 11:31:11 +0000 (14:31 +0300)
committerYuriy Obukh <Bleach665@gmail.com>
Thu, 18 Jun 2020 11:31:11 +0000 (14:31 +0300)
modules/core/include/opencv2/core/eigen.hpp

index 3d7ba8f..3f4be93 100644 (file)
 
 #include "opencv2/core.hpp"
 
-#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \
-    && defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY)
-#include <unsupported/Eigen/CXX11/Tensor>
-#define OPENCV_EIGEN_TENSOR_SUPPORT
-#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3
-
 #if defined _MSC_VER && _MSC_VER >= 1200
+#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548
 #pragma warning( disable: 4714 ) //__forceinline is not inlined
 #pragma warning( disable: 4127 ) //conditional expression is constant
 #pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data
 #endif
 
+#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \
+    && defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY)
+#include <unsupported/Eigen/CXX11/Tensor>
+#define OPENCV_EIGEN_TENSOR_SUPPORT
+#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3
+
 namespace cv
 {