From c68e15dc539f2406c41ea8b668b527abb3de0a70 Mon Sep 17 00:00:00 2001 From: Greg Tucker Date: Thu, 25 May 2017 15:49:47 -0700 Subject: [PATCH] Fix test helper function for mingw builds Change-Id: Ic24b3ba89bf03bfbc829a78d2cb8f820885ada7e Signed-off-by: Greg Tucker --- include/test.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/test.h b/include/test.h index 0b7154a..ed41a05 100644 --- a/include/test.h +++ b/include/test.h @@ -35,7 +35,7 @@ extern "C" { #endif // Use sys/time.h functions for time -#ifdef __unix__ +#if defined (__unix__) || (__APPLE__) || (__MINGW32__) #include #endif @@ -44,7 +44,7 @@ struct perf{ }; -#ifdef __unix__ +#if defined (__unix__) || (__APPLE__) || (__MINGW32__) inline int perf_start(struct perf *p) { return gettimeofday(&(p->tv), 0); @@ -62,7 +62,7 @@ inline void perf_print(struct perf stop, struct perf start, long long dsize) printf("runtime = %10lld usecs", usecs); if (dsize != 0) { #if 1 // not bug in printf for 32-bit - printf(", bandwidth %lld MB in %.4f sec = %.2f MB/s\n", dsize/(1024*1024), + printf(", bandwidth %lld MB in %.4f sec = %.2f MB/s\n", dsize/(1024*1024), ((double) usecs)/1000000, ((double) dsize) / (double)usecs); #else printf(", bandwidth %lld MB ", dsize/(1024*1024));