From 15243144c452365d8251b23955f4ad2cde990e80 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Wed, 27 Feb 2013 08:03:39 +0000 Subject: [PATCH] [1.5] Rework #ifdef checks. We should check for _M_IX86 instead of not(_M_X64). Thanks to Misha Ulyutin for report on ML --- libopenjpeg/opj_includes.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libopenjpeg/opj_includes.h b/libopenjpeg/opj_includes.h index 2b5866a9..e9194fd9 100644 --- a/libopenjpeg/opj_includes.h +++ b/libopenjpeg/opj_includes.h @@ -89,18 +89,17 @@ Most compilers implement their own version of this keyword ... /* MSVC and Borland C do not have lrintf */ #if defined(_MSC_VER) || defined(__BORLANDC__) static INLINE long lrintf(float f){ -#ifdef _M_X64 - return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f)); -#else - int i; +#ifdef _M_IX86 + long int i; _asm{ fld f fistp i }; - return i; -#endif +#else + return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f)); +#endif /* _M_IX86 */ } #endif