Skip to content

Commit 47381e2

Browse files
pcercueirgetz
authored andcommitted
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 <[email protected]>
1 parent 391f44a commit 47381e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/iio_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ uint64_t get_time_us(void)
451451
{
452452
struct timespec tp;
453453

454-
#ifdef _WIN32
454+
#ifdef _MSC_BUILD
455455
timespec_get(&tp, TIME_UTC);
456456
#else
457457
clock_gettime(CLOCK_REALTIME, &tp);

0 commit comments

Comments
 (0)