diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 972c4aa298..6d0336571d 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -331,7 +331,9 @@ inline bool juce_isfinite (FloatingPointType value) //============================================================================== #if JUCE_MSVC #pragma optimize ("t", off) - #pragma float_control (precise, on, push) + #ifndef __INTEL_COMPILER + #pragma float_control (precise, on, push) + #endif #endif /** Fast floating-point-to-integer conversion. @@ -347,6 +349,10 @@ inline bool juce_isfinite (FloatingPointType value) template inline int roundToInt (const FloatType value) noexcept { + #ifdef __INTEL_COMPILER + #pragma float_control (precise, on, push) + #endif + union { int asInt[2]; double asDouble; } n; n.asDouble = ((double) value) + 6755399441055744.0; @@ -355,10 +361,16 @@ inline int roundToInt (const FloatType value) noexcept #else return n.asInt [0]; #endif + + #ifdef __INTEL_COMPILER + #pragma float_control (pop) + #endif } #if JUCE_MSVC - #pragma float_control (pop) + #ifndef __INTEL_COMPILER + #pragma float_control (pop) + #endif #pragma optimize ("", on) // resets optimisations to the project defaults #endif