# HG changeset patch # User reimar # Date 1263658610 0 # Node ID 7d96135e445cb39a935ff9ae151cdd639e7c9d55 # Parent 8f5df7f6247ab13bca4c0c73f0d5b50ede4c2c33 Fix sockaddr_storage check to work with winsock/MinGW diff -r 8f5df7f6247a -r 7d96135e445c configure --- a/configure Sat Jan 16 15:21:36 2010 +0000 +++ b/configure Sat Jan 16 16:16:50 2010 +0000 @@ -3103,8 +3103,10 @@ if test $_winsock2_h = yes ; then _ld_sock="-lws2_32" def_winsock2_h='#define HAVE_WINSOCK2_H 1' + cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1' else def_winsock2_h='#define HAVE_WINSOCK2_H 0' + cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0' fi @@ -3112,12 +3114,16 @@ if test "$_struct_addrinfo" = auto; then _struct_addrinfo=no cat > $TMPC << EOF +#if HAVE_WINSOCK2_H +#include +#else #include #include #include +#endif int main(void) { struct addrinfo ai; return 0; } EOF - cc_check && _struct_addrinfo=yes + cc_check $cc_check_winsock2_h && _struct_addrinfo=yes fi echores "$_struct_addrinfo" @@ -3132,12 +3138,16 @@ if test "$_getaddrinfo" = auto; then _getaddrinfo=no cat > $TMPC << EOF +#if HAVE_WINSOCK2_H +#include +#else #include #include #include +#endif int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; } EOF - cc_check && _getaddrinfo=yes + cc_check $cc_check_winsock2_h && _getaddrinfo=yes fi echores "$_getaddrinfo" @@ -3152,10 +3162,14 @@ if test "$_struct_sockaddr_storage" = auto; then _struct_sockaddr_storage=no cat > $TMPC << EOF +#if HAVE_WINSOCK2_H +#include +#else #include +#endif int main(void) { struct sockaddr_storage sas; return 0; } EOF - cc_check && _struct_sockaddr_storage=yes + cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes fi echores "$_struct_sockaddr_storage"