fix: remove posix segment

This commit is contained in:
2025-09-03 20:38:30 +02:00
parent ae5ac63c67
commit 9ae586e0ba

View File

@@ -2,8 +2,6 @@
#ifdef WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
#elif _POSIX_C_SOURCE >= 199309L
#include <time.h> // for nanosleep
#else #else
#include <unistd.h> // for usleep #include <unistd.h> // for usleep
#endif #endif
@@ -11,11 +9,6 @@
void sleep_ms(int milliseconds){ // cross-platform sleep function void sleep_ms(int milliseconds){ // cross-platform sleep function
#ifdef WIN32 #ifdef WIN32
Sleep(milliseconds); Sleep(milliseconds);
#elif _POSIX_C_SOURCE >= 199309L
struct timespec ts;
ts.tv_sec = milliseconds / 1000;
ts.tv_nsec = (milliseconds % 1000) * 1000000;
nanosleep(&ts, NULL);
#else #else
if (milliseconds >= 1000) if (milliseconds >= 1000)
sleep(milliseconds / 1000); sleep(milliseconds / 1000);