From a73df876cd6418496fa2d7f423e403487b2d115a Mon Sep 17 00:00:00 2001 From: Michael Adler Date: Thu, 24 Aug 2023 03:03:48 +0200 Subject: [PATCH] fix: build on FreeBSD (#41) This commit addresses issues causing the build to break on the FreeBSD platform. --- bee/net/endpoint.cpp | 1 + bee/net/socket.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bee/net/endpoint.cpp b/bee/net/endpoint.cpp index 08202aec..2d85a5ad 100644 --- a/bee/net/endpoint.cpp +++ b/bee/net/endpoint.cpp @@ -7,6 +7,7 @@ # include # if defined(__FreeBSD__) # include +# include # endif # ifndef UNIX_PATH_MAX # define UNIX_PATH_MAX (sizeof(sockaddr_un::sun_path) / sizeof(sockaddr_un::sun_path[0])) diff --git a/bee/net/socket.cpp b/bee/net/socket.cpp index 17172098..93f580aa 100644 --- a/bee/net/socket.cpp +++ b/bee/net/socket.cpp @@ -20,6 +20,8 @@ # include # if defined(__APPLE__) # include +# elif defined(__FreeBSD__) +# include # endif #endif @@ -260,7 +262,7 @@ namespace bee::net::socket { #endif } -#if defined(_WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__) static void set_error(int err) noexcept { # if defined(_WIN32) ::WSASetLastError(err);