From b350685c94433a00c6df737bef14263ae4eb8822 Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann Date: Tue, 19 Dec 2023 12:02:07 +0100 Subject: [PATCH 1/2] BaseSocket: include time.h for timeval This should have been included from the start, but compiling with musl uncovered that it was missing. --- src/sockets/BaseSocket.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sockets/BaseSocket.h b/src/sockets/BaseSocket.h index 1019fab..1a7221f 100644 --- a/src/sockets/BaseSocket.h +++ b/src/sockets/BaseSocket.h @@ -15,6 +15,10 @@ #include "EndPoint.h" +#if !defined(_MSC_VER) +# include +#endif + namespace eipScanner { namespace sockets { class BaseSocket { From b52aa5d2ff0c5f782eda8aeb4d7157a7be084c8a Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann Date: Tue, 19 Dec 2023 12:02:12 +0100 Subject: [PATCH 2/2] BaseSocket: avoid non-standard time_t typedef time_t is defined in POSIX, __time_t is not. Uncovered by compiling using musl. --- src/sockets/BaseSocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sockets/BaseSocket.cpp b/src/sockets/BaseSocket.cpp index efb71db..7501283 100644 --- a/src/sockets/BaseSocket.cpp +++ b/src/sockets/BaseSocket.cpp @@ -95,8 +95,8 @@ namespace sockets { .tv_sec = static_cast<__darwin_suseconds_t>(recvTimeout.count()/1000), .tv_usec = static_cast<__darwin_suseconds_t>((recvTimeout.count()%1000)*1000) #elif __unix__ - .tv_sec = static_cast<__time_t>(recvTimeout.count()/1000), - .tv_usec = static_cast<__time_t>((recvTimeout.count()%1000)*1000) + .tv_sec = static_cast(recvTimeout.count()/1000), + .tv_usec = static_cast((recvTimeout.count()%1000)*1000) #elif defined(_WIN32) || defined(WIN32) || defined(_WIN64) .tv_sec = static_cast(recvTimeout.count()/1000), .tv_usec = static_cast((recvTimeout.count()%1000)*1000)