[Piglit] [PATCH 09/12] util: add usleep wrapper/define

Emil Velikov emil.l.velikov at gmail.com
Sat Nov 22 14:40:31 PST 2014


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 tests/spec/arb_timer_query/timestamp-get.c | 6 +-----
 tests/util/piglit-util.h                   | 4 ++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/spec/arb_timer_query/timestamp-get.c b/tests/spec/arb_timer_query/timestamp-get.c
index 6a7ee5a..031c7a1 100644
--- a/tests/spec/arb_timer_query/timestamp-get.c
+++ b/tests/spec/arb_timer_query/timestamp-get.c
@@ -110,12 +110,8 @@ piglit_display(void)
 	t2 = get_gpu_time_via_get(q);
 	validate_times(t1, t2, tolerance);
 
-#if defined(_WIN32) || defined(WIN32)
-	Sleep(10);
-#else
 	usleep(10000);
-#endif
-		
+
 	puts("Test: first glGet, then glQuery");
 	t1 = get_gpu_time_via_get(q);
 	t2 = get_gpu_time_via_query(q);
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 89e6ef7..441a253 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -66,6 +66,10 @@ extern "C" {
 
 #endif /* defined(_MSC_VER) */
 
+#ifdef _WIN32
+#define usleep(__usec) Sleep(((__usec) + 999)/1000)
+#endif
+
 #if (__GNUC__ >= 3)
 #define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
 #else
-- 
2.1.3



More information about the Piglit mailing list