ref: daab4bcba60759a252bd210ee5f8d7cd390962e5
parent: d6ee72a7bf2e2ef889827f4bc307fe1f930e2f1c
author: John Koleszar <jkoleszar@google.com>
date: Thu Sep 2 08:03:51 EDT 2010
Use native win32 timers on mingw 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
--- a/vpx_ports/vpx_timer.h
+++ b/vpx_ports/vpx_timer.h
@@ -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 @@
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 @@
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 @@
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;