From b513eaac00eb4a9a100506a59f85cdcff1e7d96d Mon Sep 17 00:00:00 2001 From: Michael Dodson Date: Wed, 15 Apr 2020 14:40:57 +0100 Subject: [PATCH] add freebsd support Including FreeBSD in preprocessor conditionals for APPLE fixes issues with UDP make_socket, as described in issue #488. Signed-off-by: Michael Gary Dodson --- src/ddsrt/src/sockets/posix/socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ddsrt/src/sockets/posix/socket.c b/src/ddsrt/src/sockets/posix/socket.c index e64b0c4..952f8e1 100644 --- a/src/ddsrt/src/sockets/posix/socket.c +++ b/src/ddsrt/src/sockets/posix/socket.c @@ -32,9 +32,9 @@ #include #endif -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) #include -#endif /* __APPLE__ */ +#endif /* __APPLE__ || __FreeBSD__ */ #endif /* LWIP_SOCKET */ dds_return_t @@ -316,13 +316,13 @@ ddsrt_setsockopt( goto err_setsockopt; } -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) if (level == SOL_SOCKET && optname == SO_REUSEADDR && setsockopt(sock, level, SO_REUSEPORT, optval, optlen) == -1) { goto err_setsockopt; } -#endif /* __APPLE__ */ +#endif /* __APPLE__ || __FreeBSD__ */ return DDS_RETCODE_OK; err_setsockopt: