diff --git a/configure.ac b/configure.ac index 1e4543682..301335c35 100644 --- a/configure.ac +++ b/configure.ac @@ -116,8 +116,9 @@ dnl set host_os variable AC_CANONICAL_HOST dnl ws2tcpip.h not provided by cygwin and its test causes a configure warning. +dnl wspiapi.h provides needed freeaddrinfo function on W2k systems. AS_IF([test "${host_os}" != "cygwin"], [ - AC_CHECK_HEADERS([ws2tcpip.h]) + AC_CHECK_HEADERS([ws2tcpip.h wspiapi.h]) ]) diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c index 3cf75ca12..d6586f45f 100644 --- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -48,6 +48,9 @@ #include #elif HAVE_WS2TCPIP_H #include +# if defined(HAVE_WSPIAPI_H) +# include +# endif #endif /* diff --git a/src/network.c b/src/network.c index a1ec05eda..214ecd48e 100644 --- a/src/network.c +++ b/src/network.c @@ -59,6 +59,9 @@ #include #elif HAVE_WS2TCPIP_H #include +# if defined(HAVE_WSPIAPI_H) +# include +# endif #endif #include "hamlib/rig.h" diff --git a/tests/rigctld.c b/tests/rigctld.c index 8bdee9efb..fd9abb6cc 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -49,6 +49,9 @@ #elif HAVE_WS2TCPIP_H #include #include +# if defined(HAVE_WSPIAPI_H) +# include +# endif #endif #ifdef HAVE_NETDB_H #include diff --git a/tests/rotctld.c b/tests/rotctld.c index 14da98515..eb4acf5f0 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -48,6 +48,9 @@ #elif HAVE_WS2TCPIP_H #include #include +# if defined(HAVE_WSPIAPI_H) +# include +# endif #endif #ifdef HAVE_NETDB_H #include