From b595d73d6d4246a46e9950819f1dbdc1e2ef91ce Mon Sep 17 00:00:00 2001 From: Miroslav Kobetski Date: Mon, 12 Aug 2013 20:08:06 +0200 Subject: [PATCH 1/2] defined uint for non-windows platforms too. replaced isnan for cvIsNaN. --- cmake/OpenCVFindLibsGUI.cmake | 2 +- modules/core/include/opencv2/core/cvdef.h | 1 + modules/stitching/src/motion_estimators.cpp | 10 ++-------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmake/OpenCVFindLibsGUI.cmake b/cmake/OpenCVFindLibsGUI.cmake index 04c77d8ec5..270853aeec 100644 --- a/cmake/OpenCVFindLibsGUI.cmake +++ b/cmake/OpenCVFindLibsGUI.cmake @@ -70,7 +70,7 @@ endif(WITH_OPENGL) if(APPLE) if(WITH_CARBON) set(HAVE_CARBON YES) - elif(NOT IOS) + elseif(NOT IOS) set(HAVE_COCOA YES) endif() endif() diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index 5a70d38a71..2130157e77 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -204,6 +204,7 @@ # else # include # endif + typedef uint32_t uint; #else typedef unsigned uint; #endif diff --git a/modules/stitching/src/motion_estimators.cpp b/modules/stitching/src/motion_estimators.cpp index abd43b11fb..7ceb49584f 100644 --- a/modules/stitching/src/motion_estimators.cpp +++ b/modules/stitching/src/motion_estimators.cpp @@ -42,13 +42,7 @@ #include "precomp.hpp" #include "opencv2/calib3d/calib3d_c.h" - -#ifdef _MSC_VER - #include - #define isnan(x) _isnan(x) -#else - #include -#endif +#include "opencv2/core/cvdef.h" using namespace cv; using namespace cv::detail; @@ -259,7 +253,7 @@ bool BundleAdjusterBase::estimate(const std::vector &features, bool ok = true; for (int i = 0; i < cam_params_.rows; ++i) { - if (isnan(cam_params_.at(i,0))) + if (cvIsNaN(cam_params_.at(i,0))) { ok = false; break; From ed29d91d42b19fb61cc4ef12e061e131f23bc5d6 Mon Sep 17 00:00:00 2001 From: kamjagin Date: Wed, 14 Aug 2013 11:25:49 +0200 Subject: [PATCH 2/2] adding std to cstdint typedef of uint32_t --- cmake/OpenCVFindLibsGUI.cmake | 2 +- modules/core/include/opencv2/core/cvdef.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVFindLibsGUI.cmake b/cmake/OpenCVFindLibsGUI.cmake index 270853aeec..04c77d8ec5 100644 --- a/cmake/OpenCVFindLibsGUI.cmake +++ b/cmake/OpenCVFindLibsGUI.cmake @@ -70,7 +70,7 @@ endif(WITH_OPENGL) if(APPLE) if(WITH_CARBON) set(HAVE_CARBON YES) - elseif(NOT IOS) + elif(NOT IOS) set(HAVE_COCOA YES) endif() endif() diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index 2130157e77..46f294962d 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -201,10 +201,11 @@ #if !defined _MSC_VER && !defined __BORLANDC__ # if defined __cplusplus && __cplusplus >= 201103L # include + typedef std::uint32_t uint; # else # include + typedef uint32_t uint; # endif - typedef uint32_t uint; #else typedef unsigned uint; #endif