<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 6503c0ff04c6b5cc091a9f58b066cf338559ddf7 Mon Sep 17 00:00:00 2001
From: barracuda156 &lt;vital.had@gmail.com&gt;
Date: Tue, 4 Jun 2024 09:18:00 +0800
Subject: [PATCH] ddsi_udp.c: use ip_mreqn where it is actually available

---
 src/core/ddsi/src/ddsi_udp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git src/core/ddsi/src/ddsi_udp.c src/core/ddsi/src/ddsi_udp.c
index 5ad3b4b8..8089682b 100644
--- src/core/ddsi/src/ddsi_udp.c
+++ src/core/ddsi/src/ddsi_udp.c
@@ -9,6 +9,11 @@
  *
  * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
  */
+
+#ifdef __APPLE__
+#include &lt;AvailabilityMacros.h&gt;
+#endif
+
 #include &lt;assert.h&gt;
 #include &lt;string.h&gt;
 #include "dds/ddsrt/atomics.h"
@@ -385,7 +390,9 @@
 
 static dds_return_t set_mc_options_transmit_ipv4_if (struct ddsi_domaingv const * const gv, struct nn_interface const * const intf, ddsrt_socket_t sock)
 {
-#if (defined(__linux) || defined(__APPLE__)) &amp;&amp; !LWIP_SOCKET
+/* ip_mreqn is available on macOS 10.7+ */
+#if ((defined(__APPLE__) &amp;&amp; defined(MAC_OS_X_VERSION_10_7) &amp;&amp; (MAC_OS_X_VERSION_MIN_REQUIRED &gt;= MAC_OS_X_VERSION_10_7)) \
+  || defined(__linux)) &amp;&amp; !LWIP_SOCKET
   if (gv-&gt;config.use_multicast_if_mreqn)
   {
     struct ip_mreqn mreqn;
</pre></body></html>