Commit 32da602b authored by Alexander Alekhin's avatar Alexander Alekhin

fix build (related to PR #3814)

parent 97bdc92d
......@@ -44,6 +44,14 @@
using namespace cv;
// std::isnan is a part of C++11 and it is not supported in MSVS2010/2012
#if defined _MSC_VER && _MSC_VER < 1800 /* MSVC 2013 */
#include <float.h>
namespace std {
template <typename T> bool isnan(T value) { return _isnan(value) != 0; }
}
#endif
template <typename T> struct pixelInfo_
{
static const int channels = 1;
......@@ -130,7 +138,7 @@ class DistAbs
if (std::isnan(w)) w = 1.0; // Handle h = 0.0
static const double WEIGHT_THRESHOLD = 0.001;
WT weight = (WT)round(fixed_point_mult * w);
WT weight = (WT)cvRound(fixed_point_mult * w);
if (weight < WEIGHT_THRESHOLD * fixed_point_mult) weight = 0;
return weight;
......@@ -252,7 +260,7 @@ class DistSquared
if (std::isnan(w)) w = 1.0; // Handle h = 0.0
static const double WEIGHT_THRESHOLD = 0.001;
WT weight = (WT)round(fixed_point_mult * w);
WT weight = (WT)cvRound(fixed_point_mult * w);
if (weight < WEIGHT_THRESHOLD * fixed_point_mult) weight = 0;
return weight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment