[1.5] Rework #ifdef checks. We should check for _M_IX86 instead of not(_M_X64). Thanks to Misha Ulyutin for report on ML

This commit is contained in:
Mathieu Malaterre 2013-02-27 08:03:39 +00:00
parent c0c69d1c36
commit 15243144c4
1 changed files with 5 additions and 6 deletions

View File

@ -89,18 +89,17 @@ Most compilers implement their own version of this keyword ...
/* MSVC and Borland C do not have lrintf */ /* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__) #if defined(_MSC_VER) || defined(__BORLANDC__)
static INLINE long lrintf(float f){ static INLINE long lrintf(float f){
#ifdef _M_X64 #ifdef _M_IX86
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f)); long int i;
#else
int i;
_asm{ _asm{
fld f fld f
fistp i fistp i
}; };
return i; return i;
#endif #else
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
#endif /* _M_IX86 */
} }
#endif #endif