there are 2 problems when compiling on windows of using variables not declared:
$ gcc mdns.c
1.//
mdns.c: In function 'open_client_sockets':
mdns.c:487:14: error: 'IP_ADAPTER_ADDRESSES_XP' {aka 'struct _IP_ADAPTER_ADDRESSES_XP'} has no member named 'TunnelType'
if (adapter->TunnelType == TUNNEL_TYPE_TEREDO)
^~
2.//
mdns.c: In function 'open_service_sockets':
mdns.c:672:24: error: 'in4addr_any' undeclared (first use in this function); did you mean 'in6addr_any'?
sock_addr.sin_addr = in4addr_any;
^~~~~~~~~~~
in6addr_any
mdns.c:672:24: note: each undeclared identifier is reported only once for each function it appears in
I also needed to link to -lwsock32 -lWs2_32 -liphlpapi
there are 2 problems when compiling on windows of using variables not declared:
$ gcc mdns.c
1.//
mdns.c: In function 'open_client_sockets':
mdns.c:487:14: error: 'IP_ADAPTER_ADDRESSES_XP' {aka 'struct _IP_ADAPTER_ADDRESSES_XP'} has no member named 'TunnelType'
if (adapter->TunnelType == TUNNEL_TYPE_TEREDO)
^~
2.//
mdns.c: In function 'open_service_sockets':
mdns.c:672:24: error: 'in4addr_any' undeclared (first use in this function); did you mean 'in6addr_any'?
sock_addr.sin_addr = in4addr_any;
^~~~~~~~~~~
in6addr_any
mdns.c:672:24: note: each undeclared identifier is reported only once for each function it appears in
I also needed to link to -lwsock32 -lWs2_32 -liphlpapi