fix some compile problems with mingw

This commit is contained in:
Simon Goldschmidt 2022-01-12 22:16:00 +01:00
parent a55679224f
commit 215dec653b
3 changed files with 19 additions and 15 deletions

View File

@ -41,7 +41,7 @@ sntp_set_system_time(u32_t sec)
struct tm current_time_val; struct tm current_time_val;
time_t current_time = (time_t)sec; time_t current_time = (time_t)sec;
#ifdef _MSC_VER #if defined(_WIN32) || defined(WIN32)
localtime_s(&current_time_val, &current_time); localtime_s(&current_time_val, &current_time);
#else #else
localtime_r(&current_time, &current_time_val); localtime_r(&current_time, &current_time_val);

View File

@ -50,6 +50,11 @@
#define LWIP_PROVIDE_ERRNO /* provide errno for non-MSVC */ #define LWIP_PROVIDE_ERRNO /* provide errno for non-MSVC */
#endif /* _MSC_VER */ #endif /* _MSC_VER */
#ifdef __GNUC__
#define LWIP_TIMEVAL_PRIVATE 0
#include <sys/time.h>
#endif
/* Define platform endianness (might already be defined) */ /* Define platform endianness (might already be defined) */
#ifndef BYTE_ORDER #ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN #define BYTE_ORDER LITTLE_ENDIAN

View File

@ -102,7 +102,6 @@ pcapifh_alloc_readonly_copy(void *data, size_t len)
lwip_win32_platform_diag("VirtualProtect failed: %d\n", GetLastError()); lwip_win32_platform_diag("VirtualProtect failed: %d\n", GetLastError());
while(1); while(1);
} }
printf("pcapifh_alloc_readonly_copy(%d): 0x%08x\n", len, ret);
return ret; return ret;
} }