]> granicus.if.org Git - libvpx/commitdiff
Add roundf and lroundf replacements for VS < 2013.
authorAlex Converse <aconverse@google.com>
Thu, 7 Apr 2016 22:16:30 +0000 (15:16 -0700)
committerAlex Converse <aconverse@google.com>
Thu, 7 Apr 2016 22:17:30 +0000 (15:17 -0700)
Change-Id: I25678279ab44672acf680bf04d9c551156e2904b

vpx_ports/msvc.h

index cab77405f47ef34f7406c81dc4da4741f62ca630..d6b8503b0dee70db9f1975c414a4f8562f001337 100644 (file)
@@ -26,6 +26,20 @@ static INLINE double round(double x) {
   else
     return floor(x + 0.5);
 }
+
+static INLINE float roundf(float x) {
+  if (x < 0)
+    return (float)ceil(x - 0.5f);
+  else
+    return (float)floor(x + 0.5f);
+}
+
+static INLINE long lroundf(float x) {
+  if (x < 0)
+    return (long)(x - 0.5f);
+  else
+    return (long)(x + 0.5f);
+}
 #endif  // _MSC_VER < 1800
 
 #endif  // _MSC_VER