1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-23 15:50:05 +02:00

Use our versions of lrint and lrintf to ensure performance

This commit is contained in:
Leland Lucius 2021-03-18 08:05:02 -05:00
parent 1bbfd3db5e
commit e37155b07c

@ -41,8 +41,11 @@
** process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in ** process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in
** the config.h file. ** the config.h file.
*/ */
#if (defined (WIN32) || defined (_WIN32)) && defined(_MSC_VER) && defined(_M_IX86) #if (defined (WIN32) || defined (_WIN32)) && defined(_MSC_VER) && defined(_M_IX86)
// As of Visual Studio 2019 16.9, these functions have been made intrinsic and the build
// will fail. Unfortunately, the intrinsic versions run a LOT slower than the ones
// below, so force the compiler to use ours instead.
#pragma function( lrint, lrintf )
// Including math.h allows us to use the inline assembler versions without // Including math.h allows us to use the inline assembler versions without
// producing errors in newer Visual Studio versions. // producing errors in newer Visual Studio versions.
@ -56,7 +59,6 @@
/* Win32 doesn't seem to have these functions. /* Win32 doesn't seem to have these functions.
** Therefore implement inline versions of these functions here. ** Therefore implement inline versions of these functions here.
*/ */
#if _MSC_VER < 1928
__inline long int __inline long int
lrint (double flt) lrint (double flt)
{ int intgr; { int intgr;
@ -80,7 +82,7 @@
return intgr ; return intgr ;
} }
#endif
__inline long long int __inline long long int
llrint (double flt) llrint (double flt)
{ long long int intgr; { long long int intgr;