From 626d906d3ad46d46a6c90cf3239fd60bad5dc318 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 1 Nov 2010 14:48:04 +0100 Subject: Better configure test that also works on windows. --- lib/odbc/c_src/odbcserver.c | 2 +- lib/odbc/configure.in | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c index 78a6fc41a8..84b9a99192 100644 --- a/lib/odbc/c_src/odbcserver.c +++ b/lib/odbc/c_src/odbcserver.c @@ -1741,7 +1741,7 @@ static int connect_to_erlang(const char *port) #endif struct sockaddr_in sin; -#if defined(AF_INET6) +#if defined(HAVE_STRUCT_SOCKADDR_IN6_SIN6_ADDR) && defined(AF_INET6) struct sockaddr_in6 sin6; sock = socket(AF_INET6, SOCK_STREAM, 0); diff --git a/lib/odbc/configure.in b/lib/odbc/configure.in index 94e8a214d4..c16d4f3880 100644 --- a/lib/odbc/configure.in +++ b/lib/odbc/configure.in @@ -118,11 +118,18 @@ AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h netdb.h stdlib.h string.h sys/socket.h]) +AC_CHECK_HEADERS([fcntl.h netdb.h stdlib.h string.h sys/socket.h winsock2.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T +AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_addr], [], [], + [#if HAVE_WINSOCK2_H + #include + #include + #else + #include + #endif]) dnl Checks for library functions. AC_CHECK_FUNCS([memset socket]) -- cgit v1.2.3