Skip to content

Commit

Permalink
Return to using private (l)lrint(f) inline functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lllucius committed Mar 16, 2015
1 parent 08cceb6 commit 5d3e9ad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/float_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -112,7 +120,7 @@

return intgr ;
}
#endif

#else

/* dmazzoni: modified these to do a proper rounding, even though
Expand Down

0 comments on commit 5d3e9ad

Please sign in to comment.