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.
Unified · Split
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #ifndef VPX_TIMER_H |
| 13 | 13 | #define VPX_TIMER_H |
| 14 | 14 | |
| 15 | −#if defined(_MSC_VER) | |
| 15 | +#if defined(_WIN32) | |
| 16 | 16 | /* |
| 17 | 17 | * Win32 specific includes |
| 18 | 18 | */ |
| @@ -43,7 +43,7 @@ · 24 unmodified lines | ||
| 43 | 43 | |
| 44 | 44 | struct vpx_usec_timer |
| 45 | 45 | { |
| 46 | −#if defined(_MSC_VER) | |
| 46 | +#if defined(_WIN32) | |
| 47 | 47 | LARGE_INTEGER begin, end; |
| 48 | 48 | #else |
| 49 | 49 | struct timeval begin, end; |
| @@ -54,7 +54,7 @@ struct vpx_usec_timer · 4 unmodified lines | ||
| 54 | 54 | static void |
| 55 | 55 | vpx_usec_timer_start(struct vpx_usec_timer *t) |
| 56 | 56 | { |
| 57 | −#if defined(_MSC_VER) | |
| 57 | +#if defined(_WIN32) | |
| 58 | 58 | QueryPerformanceCounter(&t->begin); |
| 59 | 59 | #else |
| 60 | 60 | gettimeofday(&t->begin, NULL); |
| @@ -65,7 +65,7 @@ vpx_usec_timer_start(struct vpx_usec_timer *t) · 4 unmodified lines | ||
| 65 | 65 | static void |
| 66 | 66 | vpx_usec_timer_mark(struct vpx_usec_timer *t) |
| 67 | 67 | { |
| 68 | −#if defined(_MSC_VER) | |
| 68 | +#if defined(_WIN32) | |
| 69 | 69 | QueryPerformanceCounter(&t->end); |
| 70 | 70 | #else |
| 71 | 71 | gettimeofday(&t->end, NULL); |
| @@ -76,7 +76,7 @@ vpx_usec_timer_mark(struct vpx_usec_timer *t) · 4 unmodified lines | ||
| 76 | 76 | static long |
| 77 | 77 | vpx_usec_timer_elapsed(struct vpx_usec_timer *t) |
| 78 | 78 | { |
| 79 | −#if defined(_MSC_VER) | |
| 79 | +#if defined(_WIN32) | |
| 80 | 80 | LARGE_INTEGER freq, diff; |
| 81 | 81 | |
| 82 | 82 | diff.QuadPart = t->end.QuadPart - t->begin.QuadPart; |