From b3c0df703f3e944d891e34ecfd4a58f9708df86c Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 19 Nov 2012 15:57:58 +0000 Subject: [PATCH] Avoid warnings in Intel compiler. --- modules/juce_core/maths/juce_MathsFunctions.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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