changeset 6579:dd7b19b63d56

replaced std::isnan() and !std::isfinite() by msvc primitives
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Jan 2026 16:55:17 +0100
parents 0d650504d32c
children e16d84c4d0e5
files OrthancFramework/Sources/CompatibilityMath.h
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/CompatibilityMath.h	Tue Jan 27 16:14:41 2026 +0100
+++ b/OrthancFramework/Sources/CompatibilityMath.h	Tue Jan 27 16:55:17 2026 +0100
@@ -55,7 +55,8 @@
  * https://www.boost.org/doc/libs/1_89_0/boost/math/tools/config.hpp
  **/
 
-#include <cmath>
+#include <cfloat>  // For _isnan()
+#include <cmath>   // For _isnanf()
 #include <limits>
 
 namespace Orthanc
@@ -95,8 +96,8 @@
       bool RoundFloatWithChecks(T& target,
                                 float source)
       {
-        if (std::isnan(source) ||
-            !std::isfinite(source))
+        if (_isnanf(source) ||
+            !_finitef(source))
         {
           return false;
         }
@@ -121,8 +122,8 @@
       bool RoundDoubleWithChecks(T& target,
                                  double source)
       {
-        if (std::isnan(source) ||
-            !std::isfinite(source))
+        if (_isnan(source) ||
+            !_finite(source))
         {
           return false;
         }