For MSVC builds, implement 'rint()' and 'rintf()' to supplement the ones that were...
authorJohn Emmas <johne53@tiscali.co.uk>
Fri, 24 Apr 2015 18:11:10 +0000 (19:11 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Fri, 24 Apr 2015 18:11:10 +0000 (19:11 +0100)
gtk2_ardour/export_video_dialog.cc
gtk2_ardour/processor_box.cc
msvc_extra_headers/ardourext/float_cast.h.input
msvc_extra_headers/ardourext/misc.h.input

index e8b823dc90f92d166e6cf0316751ff649e27df51..13f1f8fe4d4e5e46fd79b6c330a5be6c27bf116b 100644 (file)
 #include "utils_videotl.h"
 #include "i18n.h"
 
-#ifdef COMPILER_MSVC
-#define rintf(x) round((x) + 0.5)
-#endif
-
 using namespace Gtk;
 using namespace std;
 using namespace PBD;
index d4c240feafb72a805192c19788d96e2bd2c8fb3c..e801aaeb7404a214ca2149f1e2ffda66e50ac106 100644 (file)
 #include "gtk2ardour-config.h"
 #endif
 
-#ifdef COMPILER_MSVC
-#define rintf(x) round((x) + 0.5)
-#endif
-
 #include <cmath>
 #include <iostream>
 #include <set>
index 2ba3bbbe62f2d0547d3b75d705bc20eee63c3cbe..94433da9657a1c39d40709eacf8c5c58e1f00027 100644 (file)
                return intgr ;
        }
 
+       __inline double
+       rint (double flt)
+       {       long long int intgr;
+
+               _asm
+               {       fld flt
+                       fistp intgr
+                       } ;
+
+               return (double) intgr ;
+       }
+
        __inline long int
        lrintf (float flt)
        {       int intgr;
                return intgr ;
        }
 
+       __inline float
+       rintf (float flt)
+       {       int intgr;
+
+               _asm
+               {       fld flt
+                       fistp intgr
+                       } ;
+
+               return (float) intgr ;
+       }
+
        __inline long long int 
        llrint (double flt)
        {       long long int intgr;
index 5da7c41564ff2d4b23ddddac3406da8e9a2fb508..9bcba6f327dacd8d13762db2f0bd815ae9c42674 100644 (file)
@@ -247,11 +247,6 @@ inline int64_t abs(int64_t val) throw()
        extern bool operator == (const Type& lhs, const Type& rhs);
 #endif
 
-// round().... Unlike Linux, Windows doesn't seem to support the
-// concept of a system-wide (or programmable) rounding direction.
-// Fortunately, 'round to nearest' seems to be the default action
-// under Linux, so let's copy that until we find out otherwise.
-#define rint(value)  round(value)
 #if !defined(LIBPBD_API) || defined(PBD_IS_IN_WIN_STATIC_LIB)
 extern  double round(double x);