Use native win32 timers on mingw
authorJohn Koleszar <jkoleszar@google.com>
Thu, 2 Sep 2010 16:03:51 +0000 (12:03 -0400)
committerJohn Koleszar <jkoleszar@google.com>
Thu, 2 Sep 2010 16:03:51 +0000 (12:03 -0400)
Changed to use QueryPerformanceCounter on Windows rather than only
when building with MSVC, so that MSVC can link libs built with
MinGW.

Fixes issue #149.

Change-Id: Ie2dc7edc8f4d096cf95ec5ffb1ab00f2d67b3e7d

vpx_ports/vpx_timer.h

index f5e817f..f2a5a7e 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef VPX_TIMER_H
 #define VPX_TIMER_H
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 /*
  * Win32 specific includes
  */
@@ -43,7 +43,7 @@
 
 struct vpx_usec_timer
 {
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     LARGE_INTEGER  begin, end;
 #else
     struct timeval begin, end;
@@ -54,7 +54,7 @@ struct vpx_usec_timer
 static void
 vpx_usec_timer_start(struct vpx_usec_timer *t)
 {
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     QueryPerformanceCounter(&t->begin);
 #else
     gettimeofday(&t->begin, NULL);
@@ -65,7 +65,7 @@ vpx_usec_timer_start(struct vpx_usec_timer *t)
 static void
 vpx_usec_timer_mark(struct vpx_usec_timer *t)
 {
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     QueryPerformanceCounter(&t->end);
 #else
     gettimeofday(&t->end, NULL);
@@ -76,7 +76,7 @@ vpx_usec_timer_mark(struct vpx_usec_timer *t)
 static long
 vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
 {
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     LARGE_INTEGER freq, diff;
 
     diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;