diff --git a/lib/debug_config.c b/lib/debug_config.c index 2f058be..5521d15 100644 --- a/lib/debug_config.c +++ b/lib/debug_config.c @@ -217,7 +217,8 @@ void debug_output(debug_level_t level, debug_category_t category, /* Add timestamp with microseconds: hh:mm:ss-xxx.yyy */ struct timeval tv; gettimeofday(&tv, NULL); - struct tm* tm_info = localtime(&tv.tv_sec); + time_t tv_sec = (time_t)tv.tv_sec; + struct tm* tm_info = localtime(&tv_sec); char time_str[32]; strftime(time_str, sizeof(time_str), "%H:%M:%S", tm_info); offset += snprintf(buffer + offset, remaining, "[%s-%03ld.%03ld] ", time_str, tv.tv_usec / 1000, tv.tv_usec % 1000); diff --git a/lib/platform_compat.h b/lib/platform_compat.h index bef3b4e..6a82d08 100644 --- a/lib/platform_compat.h +++ b/lib/platform_compat.h @@ -103,6 +103,9 @@ // nanosleep already defined in pthread_time.h on MSYS2 + // poll is in ws2tcpip.h or poll.h on MSYS2 + #include + #else // POSIX - include standard headers #include diff --git a/src/config_parser.h b/src/config_parser.h index 15a99c5..fa5d9c4 100644 --- a/src/config_parser.h +++ b/src/config_parser.h @@ -4,9 +4,7 @@ #include #include -#include -#include -#include +#include "../lib/platform_compat.h" #ifdef __cplusplus extern "C" {