shithub: libvpx

Download patch

ref: c202100fe408499e8a18a5878af0fcfc74bfc635
parent: 6a5e6e054951cefc337734f4c0f3c97582c59e09
author: Yaowu Xu <yaowu@google.com>
date: Tue Dec 4 07:28:10 EST 2012

Enable unit tests to build with MSVC

Change-Id: Ie80597221bee494679ae2ba50cca22dea2609cba

--- a/libs.mk
+++ b/libs.mk
@@ -425,6 +425,7 @@
             --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \
             --ver=$(CONFIG_VS_VERSION) \
             --src-path-bare="$(SRC_PATH_BARE)" \
+            -D_VARIADIC_MAX=10 \
             --out=gtest.vcproj $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \
             -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src"
 
@@ -436,6 +437,7 @@
             --exe \
             --target=$(TOOLCHAIN) \
             --name=test_libvpx \
+            -D_VARIADIC_MAX=10 \
             --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
             --ver=$(CONFIG_VS_VERSION) \
             $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--- a/test/idct8x8_test.cc
+++ b/test/idct8x8_test.cc
@@ -25,6 +25,15 @@
 
 namespace {
 
+#ifdef _MSC_VER
+static int round(double x) {
+  if(x < 0)
+    return (int)ceil(x - 0.5);
+  else
+    return (int)floor(x + 0.5);
+}
+#endif
+
 void reference_dct_1d(double input[8], double output[8]) {
   const double kPi = 3.141592653589793238462643383279502884;
   const double kInvSqrt2 = 0.707106781186547524400844362104;