Library ws2_32 is required when compiling on Windows but the autoconf macro
to test for a library doesn't work due to the special declaration of the
functions in that library.
dnl check for structure members
AC_CHECK_MEMBER([struct sockaddr_storage.ss_len],[AC_DEFINE([HAVE_SOCKADDR_SA_LEN],1,[ss_len in sockaddr_storage])])
+dnl windows require this library
+if test $ac_cv_header_winsock_h = "yes" ; then
+# AC_CHECK_LIBS([ws2_32],[WSAGetLastError]) fails because of the __stdcall in the function prototype
+ LIBS="$LIBS -lws2_32"
+fi
+
dnl check for the rlim_t size
AC_CHECK_SIZEOF(rlim_t,1,[#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>