libcollectdclient: Fix BSD support.
authorFlorian Forster <octo@collectd.org>
Thu, 4 May 2017 07:30:25 +0000 (09:30 +0200)
committerFlorian Forster <octo@collectd.org>
Thu, 4 May 2017 07:30:25 +0000 (09:30 +0200)
FreeBSD needs <sys/endian.h> instead of <endian.h>.

configure.ac
src/libcollectdclient/network_parse.c

index b6a47dc..ded4630 100644 (file)
@@ -175,6 +175,7 @@ AC_CHECK_HEADERS_ONCE([ \
   pthread_np.h \
   pwd.h \
   regex.h \
+  sys/endian.h \
   sys/fs_types.h \
   sys/fstyp.h \
   sys/ioctl.h \
index cbd434b..02e14b9 100644 (file)
 #include <math.h>
 #include <pthread.h>
 
+/* for be{16,64}toh */
+#if HAVE_ENDIAN_H
+#include <endian.h>
+#elif HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+
 #define GCRYPT_NO_DEPRECATED
 #include <gcrypt.h>