From 47381e2dd067d3fc5cfd79323c59fdcc66e65603 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Wed, 6 Apr 2022 15:50:28 +0100 Subject: [PATCH] tests: Fix build under MinGW MinGW 32-bit does not have timespec_get(). Strangely, the 64-bit version does have it. But both have clock_gettime(), so only use timespec_get() when building under Visual Studio. Fixes #830. Signed-off-by: Paul Cercueil --- tests/iio_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/iio_common.c b/tests/iio_common.c index a5b90f2a4..e88c093e8 100644 --- a/tests/iio_common.c +++ b/tests/iio_common.c @@ -451,7 +451,7 @@ uint64_t get_time_us(void) { struct timespec tp; -#ifdef _WIN32 +#ifdef _MSC_BUILD timespec_get(&tp, TIME_UTC); #else clock_gettime(CLOCK_REALTIME, &tp);