[Piglit] [PATCH] util: Use Sleep for Windows.

Vinson Lee vlee at freedesktop.org
Sat Nov 12 01:47:21 UTC 2016


Fix MinGW warning.

piglit-util.c: In function 'piglit_delay_ns':
piglit-util.c:634:2: warning: implicit declaration of function 'usleep' [-Wimplicit-function-declaration]
  usleep(time_ns / 1000);
  ^~~~~~

Fixes: e0048f4940f7 ("util: Add piglit_delay_ns() api")
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 6b34c46f8549..08fa66b5f2d0 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -630,6 +630,8 @@ piglit_delay_ns(int64_t time_ns)
 
 	while (nanosleep(&ts, &ts) == -1 && errno == EINTR)
 		;
+#elif defined(_WIN32)
+	Sleep(time_ns / 1000 / 1000);
 #else
 	usleep(time_ns / 1000);
 #endif
-- 
2.10.2



More information about the Piglit mailing list