]> granicus.if.org Git - libvpx/commitdiff
Enable unit tests to build with MSVC
authorYaowu Xu <yaowu@google.com>
Tue, 4 Dec 2012 20:28:10 +0000 (12:28 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 4 Dec 2012 20:29:26 +0000 (12:29 -0800)
Change-Id: Ie80597221bee494679ae2ba50cca22dea2609cba

libs.mk
test/idct8x8_test.cc

diff --git a/libs.mk b/libs.mk
index 58151a66da66e2b615390aaa17020e9dcdac4296..97892cc005a7a12f370d9f12688b2eaff50e89e2 100644 (file)
--- a/libs.mk
+++ b/libs.mk
@@ -425,6 +425,7 @@ gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
             --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 @@ test_libvpx.vcproj: $(LIBVPX_TEST_SRCS)
             --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) \
index 7cf7aa0eae147fc4d57c5462b5d13191a5f69bb0..ab71e85669fce8322b110983d3ffe601fe9c3c70 100644 (file)
@@ -25,6 +25,15 @@ using libvpx_test::ACMRandom;
 
 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;