Closed rednaxelafx closed 11 years ago
MSVC (upto VS2012) doesn't implement std::isnan() in <cmath>, but it does provide _isnan() since VC6.
std::isnan()
<cmath>
_isnan()
A quick-n-dirty patch to make date_utils.h compile in VS2012 is:
date_utils.h
diff --git a/iv/date_utils.h b/iv/date_utils.h index f987fd2..e728de3 100644 --- a/iv/date_utils.h +++ b/iv/date_utils.h @@ -379,8 +379,14 @@ class DateInstance { } void SetValue(double value) { +#ifdef _MSC_VER +#define ISNAN(n) _isnan(n) +#else +#define ISNAN(n) std::isnan(n) +#endif value_ = value; - invalidate_ = (std::isnan(value)) ? NG : INVALIDATED; + invalidate_ = (ISNAN(value)) ? NG : INVALIDATED; +#undef ISNAN } bool IsValid() const { return invalidate_ != NG; }
It could be written in a more elegant way, though. I'll leave that to Suzuki-san :-)
We can use iv::core::math::IsNaN in iv/platform_math.h
iv::core::math::IsNaN
iv/platform_math.h
Fixed in f6c99f12193c3cd656b37ac90a94c7d816f375d7. Thanks!
Thank you!
MSVC (upto VS2012) doesn't implement
std::isnan()
in<cmath>
, but it does provide_isnan()
since VC6.A quick-n-dirty patch to make
date_utils.h
compile in VS2012 is:It could be written in a more elegant way, though. I'll leave that to Suzuki-san :-)