From 95375a5587cad20f7616bc9cdb405ed22e333980 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 7 May 2023 09:45:27 -0500 Subject: [PATCH] Fix multicast test compile https://github.com/Hamlib/Hamlib/issues/695 --- include/hamlib/rig.h | 3 +++ src/multicast.c | 2 ++ src/multicast.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 71f3e4227..7aed44d7d 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -45,6 +45,7 @@ /* Rig list is in a separate file so as not to mess up w/ this one */ #include +#include /** * \addtogroup rig @@ -2479,6 +2480,8 @@ struct multicast_s #ifdef HAVE_ARPA_INET_H struct ip_mreq mreq; // = {0}; struct sockaddr_in dest_addr; // = {0}; +#else +#warning NO ARPA_INET #endif }; diff --git a/src/multicast.c b/src/multicast.c index 78a9c30c3..2b50055fb 100644 --- a/src/multicast.c +++ b/src/multicast.c @@ -246,6 +246,8 @@ int multicast_init(RIG *rig, char *addr, int port) } else if (rig->state.multicast->multicast_running) { return RIG_OK; } // we only need one port + //rig->state.multicast->mreq = {0}; + if (addr == NULL) { addr = RIG_MULTICAST_ADDR; } if (port == 0) { port = RIG_MULTICAST_PORT; } diff --git a/src/multicast.h b/src/multicast.h index d00e876c8..1caf9f7e6 100644 --- a/src/multicast.h +++ b/src/multicast.h @@ -24,8 +24,11 @@ struct multicast_s int runflag; // = 0; pthread_t threadid; #ifdef HAVE_ARPA_INET_H +#warn HAVE_ARPA_INET struct ip_mreq mreq; // = {0}; struct sockaddr_in dest_addr; // = {0}; +#else +#warn DO NOT HAVE ARPA_INET_H #endif }; #endif