From f2e44aa66400206f4a8605b7622789304aaab1d0 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Fri, 7 Aug 2015 18:27:48 -0700 Subject: [PATCH] Move the msvc round() replacement to msvc.h Change-Id: If470411c3c62a27f52261f4ece2c5054b71789c7 --- vp9/common/vp9_systemdependent.h | 10 ---------- vpx_ports/msvc.h | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/vp9/common/vp9_systemdependent.h b/vp9/common/vp9_systemdependent.h index 3c5062f85..e4178b249 100644 --- a/vp9/common/vp9_systemdependent.h +++ b/vp9/common/vp9_systemdependent.h @@ -33,16 +33,6 @@ void vpx_reset_mmx_state(void); #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) diff --git a/vpx_ports/msvc.h b/vpx_ports/msvc.h index 43a36e761..b08d216de 100644 --- 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_ -- 2.40.0