From a94b389965d0c0392aa0f22a6717b6fad2f2e6e3 Mon Sep 17 00:00:00 2001 From: sidney Date: Fri, 27 Dec 2024 01:39:18 +0100 Subject: [PATCH] Enable timespec_get in MINGW64 code path to see if that works (4). --- src/sim65/peripherals.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sim65/peripherals.c b/src/sim65/peripherals.c index c5c42b87e..1c62b2bfb 100644 --- a/src/sim65/peripherals.c +++ b/src/sim65/peripherals.c @@ -70,12 +70,13 @@ void PeripheralsWriteByte (uint8_t Addr, uint8_t Val) /* Using timespec_get() in the MinGW64 compiler makes the Linux workflow build fail. */ //bool time_valid = timespec_get(&ts, TIME_UTC) == TIME_UTC; /* does clock_gettime work? */ - bool time_valid = false; -#elif defined(__MINGW32__) - /* does timespec_get work? */ - /* does clock_gettime work? */ + bool time_valid = clock_gettime(CLOCK_REALTIME, &ts) == 0; //bool time_valid = false; - bool time_valid = timespec_get(&ts, TIME_UTC) == TIME_UTC; +#elif defined(__MINGW32__) + /* does timespec_get work? -- yes! */ + /* does clock_gettime work? */ + bool time_valid = false; + //bool time_valid = timespec_get(&ts, TIME_UTC) == TIME_UTC; #elif defined(_MSC_VER) /* clock_gettime() is not available when using the Microsoft compiler. Use timespec_get() instead. */ bool time_valid = timespec_get(&ts, TIME_UTC) == TIME_UTC;