mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Avoid warnings in Intel compiler.
This commit is contained in:
parent
f903695ba3
commit
b3c0df703f
1 changed files with 14 additions and 2 deletions
|
|
@ -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 <typename FloatType>
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue