shithub: libvpx

Download patch

ref: f2e44aa66400206f4a8605b7622789304aaab1d0
parent: 610e258cc5a9f8093c5d3708d8da8c81ab50bd96
author: Alex Converse <aconverse@google.com>
date: Fri Aug 7 14:27:48 EDT 2015

Move the msvc round() replacement to msvc.h

Change-Id: If470411c3c62a27f52261f4ece2c5054b71789c7

--- a/vp9/common/vp9_systemdependent.h
+++ b/vp9/common/vp9_systemdependent.h
@@ -33,16 +33,6 @@
 #define vp9_clear_system_state()
 #endif
 
-#if defined(_MSC_VER) && _MSC_VER < 1800
-// round is not defined in MSVC before VS2013.
-static INLINE double round(double x) {
-  if (x < 0)
-    return ceil(x - 0.5);
-  else
-    return floor(x + 0.5);
-}
-#endif
-
 // use GNU builtins where available.
 #if defined(__GNUC__) && \
     ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
--- a/vpx_ports/msvc.h
+++ b/vpx_ports/msvc.h
@@ -18,5 +18,14 @@
 #  define snprintf _snprintf
 # endif  // _MSC_VER < 1900
 
+#if _MSC_VER < 1800  // VS2013 provides round
+static INLINE double round(double x) {
+  if (x < 0)
+    return ceil(x - 0.5);
+  else
+    return floor(x + 0.5);
+}
+#endif  // _MSC_VER < 1800
+
 #endif  // _MSC_VER
 #endif  // VPX_PORTS_MSVC_H_