From 16f06f97c6dd9611a685b39968376a4d1f25d41f Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Wed, 7 Feb 2018 18:03:04 -0800 Subject: [PATCH] Added platform check for sleep on _WIN32 --- src/lwIP.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lwIP.cpp b/src/lwIP.cpp index c8750df..b66d83d 100644 --- a/src/lwIP.cpp +++ b/src/lwIP.cpp @@ -74,6 +74,14 @@ bool virt_can_provision_new_socket(int socket_type); #include "lwIP.h" +#if defined(_WIN32) +#include +void ms_sleep(unsigned long ms) +{ + Sleep(ms); +} +#endif + struct netif lwipInterfaces[10]; int lwipInterfacesCount = 0; @@ -192,7 +200,11 @@ static void main_thread(void *arg) DEBUG_EXTRA("stack thread init complete"); while(1) { +#if defined(_WIN32) + ms_sleep(LWIP_GUARDED_BUF_CHECK_INTERVAL); +#else usleep(LWIP_GUARDED_BUF_CHECK_INTERVAL*1000); +#endif // Handle incoming packets from the core's thread context. // If you feed frames into the core directly you will violate the core's thread model tcpip_callback_with_block(my_tcpip_callback, NULL, 1);