Add roundf and lroundf replacements for VS < 2013. Change-Id: I25678279ab44672acf680bf04d9c551156e2904b
diff --git a/vpx_ports/msvc.h b/vpx_ports/msvc.h index cab7740..d6b8503 100644 --- a/vpx_ports/msvc.h +++ b/vpx_ports/msvc.h
@@ -26,6 +26,20 @@ 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