From daab4bcba60759a252bd210ee5f8d7cd390962e5 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 2 Sep 2010 12:03:51 -0400 Subject: [PATCH] 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 --- vpx_ports/vpx_timer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vpx_ports/vpx_timer.h b/vpx_ports/vpx_timer.h index f5e817ff4..f2a5a7ec1 100644 --- 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 @@ 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; -- 2.40.0