fix declaration of struct addrinfo
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 24 Feb 2010 17:52:54 +0000 (17:52 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 24 Feb 2010 17:52:54 +0000 (17:52 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@46434 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/lib/ecore_con/Ecore_Con.h
src/lib/ecore_con/ecore_con_info.c

index 8ff36d5..e0f2d74 100644 (file)
@@ -857,20 +857,26 @@ PKG_CHECK_MODULES([EVAS], [evas >= 0.9.9],
 
 AC_HEADER_SYS_WAIT
 
+have_addrinfo="no"
 case "$host_os" in
    mingw* | cegcc*)
       AC_DEFINE(HAVE_DLFCN_H, 1, [Define to 1 if you have the <dlfcn.h> header file.])
       AC_DEFINE(HAVE_SYS_MMAN_H, 1, [Define to 1 if you have the <sys/mman.h> header file.])
       AC_DEFINE(HAVE_SYS_TIME_H, 1, [Define to 1 if you have the <sys/time.h> header file.])
+      have_addrinfo="yes"
       ;;
    *)
-      AC_CHECK_HEADERS([dlfcn.h features.h langinfo.h locale.h netdb.h sys/time.h sys/mman.h signal.h sys/resource.h])
+      AC_CHECK_HEADERS([dlfcn.h features.h langinfo.h locale.h sys/time.h sys/mman.h signal.h sys/resource.h])
       ;;
 esac
 
 # ecore_con
 
-AC_CHECK_HEADERS([arpa/inet.h netinet/tcp.h netinet/in.h sys/socket.h sys/un.h ws2tcpip.h])
+AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h netinet/tcp.h netinet/in.h sys/socket.h sys/un.h ws2tcpip.h netdb.h])
+
+if test "x${ac_cv_header_netdb_h}" = "xyes" ; then
+   have_addrinfo="yes"
+fi
 
 # Framebuffer (ecore_fb)
 have_fb="no"
@@ -979,7 +985,7 @@ ECORE_CHECK_MODULE([data], [${want_ecore_data}], [Data])
 ECORE_CHECK_MODULE([txt], [${want_ecore_txt}], [Txt], [$have_iconv])
 
 # ecore_con
-ECORE_CHECK_MODULE([con], [${want_ecore_con}], [Con])
+ECORE_CHECK_MODULE([con], [${want_ecore_con}], [Con], [${have_addrinfo}])
 
 have_curl="no"
 have_gnutls="no"
index 31c81ee..55f995f 100644 (file)
@@ -6,7 +6,9 @@
 
 #include <time.h>
 #include <libgen.h>
-#ifdef HAVE_NETDB_H
+#ifdef _WIN32
+# include <ws2tcpip.h>
+#else
 # include <netdb.h>
 #endif
 #include <Eina.h>
index a4298bd..556640f 100644 (file)
@@ -37,11 +37,26 @@ void *alloca (size_t);
 #ifdef __OpenBSD__
 # include <sys/types.h>
 #endif
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
+
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 
 #include "Ecore.h"
 #include "ecore_private.h"