Include netinet/in_systm.h in lm-sock.c, fixes LM-130.
authorMikael Hallendal <micke@imendio.com>
Thu, 28 Aug 2008 13:38:02 +0200
changeset 487 c74b31fef496
parent 486 3946c7f48a20
child 490 591bc9e3dc97
Include netinet/in_systm.h in lm-sock.c, fixes LM-130. Added check for netinet/in_systm.h and include it in lm-sock.c if it exists. It fixes a build error on BSD.
configure.ac
loudmouth/lm-sock.c
--- a/configure.ac	Thu Aug 28 13:37:51 2008 +0200
+++ b/configure.ac	Thu Aug 28 13:38:02 2008 +0200
@@ -52,7 +52,7 @@
 
 AM_PATH_GLIB_2_0
 
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h]) 
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h memory.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h sys/socket.h sys/time.h unistd.h]) 
 AC_CHECK_HEADERS([winsock2.h arpa/nameser_compat.h])
 
 if test "$ac_cv_header_winsock2_h" = "yes"; then
--- a/loudmouth/lm-sock.c	Thu Aug 28 13:37:51 2008 +0200
+++ b/loudmouth/lm-sock.c	Thu Aug 28 13:38:02 2008 +0200
@@ -19,6 +19,7 @@
  */
 
 #include <config.h>
+
 #include <glib.h>
 #include <glib/gi18n.h>
 
@@ -29,9 +30,16 @@
 #include <unistd.h>
 #include <sys/socket.h>
 #include <fcntl.h>
+
+/* Needed for BSD, LM-130 */
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
+
 #include <arpa/inet.h>
 #define LM_SHUTDOWN SHUT_RDWR