Check if we have it working now on the MinGW32 and 64 compilers.
This commit is contained in:
@@ -65,10 +65,11 @@ void PeripheralsWriteByte (uint8_t Addr, uint8_t Val)
|
|||||||
|
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_MSC_VER)
|
||||||
/* clock_gettime() is not available on Windows. Use timespec_get() instead. */
|
/* clock_gettime() is not available in the Visual Studio compiler. Use timespec_get() instead. */
|
||||||
bool time_valid = timespec_get(&ts, TIME_UTC) == TIME_UTC;
|
bool time_valid = timespec_get(&ts, TIME_UTC) == TIME_UTC;
|
||||||
#else
|
#else
|
||||||
|
/* clock_gettime() is available on Linux, MacOS, MinGW32, and MinGW64.
|
||||||
bool time_valid = clock_gettime(CLOCK_REALTIME, &ts) == 0;
|
bool time_valid = clock_gettime(CLOCK_REALTIME, &ts) == 0;
|
||||||
#endif
|
#endif
|
||||||
if (time_valid) {
|
if (time_valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user