# HG changeset patch # User Sebastien Jodogne # Date 1769530765 -3600 # Node ID e16d84c4d0e5917aacd7cc50d00f81935a10832c # Parent dd7b19b63d562de6d2a634fc010efdefe339cceb fix compatibility with Win32 diff -r dd7b19b63d56 -r e16d84c4d0e5 OrthancFramework/Sources/CompatibilityMath.h --- a/OrthancFramework/Sources/CompatibilityMath.h Tue Jan 27 16:55:17 2026 +0100 +++ b/OrthancFramework/Sources/CompatibilityMath.h Tue Jan 27 17:19:25 2026 +0100 @@ -96,24 +96,31 @@ bool RoundFloatWithChecks(T& target, float source) { +#if defined(_WIN64) + // The functions "_isnanf()" and "_finitef()" are only available if targeting x64 if (_isnanf(source) || !_finitef(source)) { return false; } +#else + if (_isnan(static_cast(source)) || + !_finite(static_cast(source))) + { + return false; + } +#endif + + const float rounded = RoundFloat(source); + if (rounded < static_cast(std::numeric_limits::min()) || + rounded > static_cast(std::numeric_limits::max())) + { + return false; + } else { - float rounded = RoundFloat(source); - if (rounded < static_cast(std::numeric_limits::min()) || - rounded > static_cast(std::numeric_limits::max())) - { - return false; - } - else - { - target = static_cast(rounded); - return true; - } + target = static_cast(rounded); + return true; } } @@ -129,7 +136,7 @@ } else { - double rounded = RoundDouble(source); + const double rounded = RoundDouble(source); if (rounded < static_cast(std::numeric_limits::min()) || rounded > static_cast(std::numeric_limits::max())) {