From 5d3e9ade95be3494eb860c014d7c799aded35464 Mon Sep 17 00:00:00 2001 From: lllucius <lllucius@47890b92-0858-11df-a26f-8b716316a5bc> Date: Mon, 16 Mar 2015 20:34:05 +0000 Subject: [PATCH] Return to using private (l)lrint(f) inline functions. --- src/float_cast.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/float_cast.h b/src/float_cast.h index f557bed25fd6..424c1127dfaa 100644 --- a/src/float_cast.h +++ b/src/float_cast.h @@ -61,10 +61,18 @@ #elif (defined (WIN32) || defined (_WIN32)) - /* Win32 doesn't seem to have these functions. + // Including math.h allows us to use the inline assembler versions without + // producing errors in newer Visual Studio versions. + // Without the include, we get different linkage error messages. + // Without the inline assembler versions, these functions are VERY slow. + // I also see that the include was part of the original source for this file: + // http://www.mega-nerd.com/FPcast/ + + #include <math.h> + + /* Win32 doesn't seem to have these functions. ** Therefore implement inline versions of these functions here. */ -#if (_MSC_VER == 1500) __inline long int lrint (double flt) { int intgr; @@ -112,7 +120,7 @@ return intgr ; } -#endif + #else /* dmazzoni: modified these to do a proper rounding, even though