Code

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 b6a47dcff4b746bea12352f51aa3098fde5c3a42..ded4630dccf98b4738a99cecd6b5477e52531414 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 cbd434b6dd31de539d138a0b932ed2a98c20d102..02e14b9b502b628ea190a13b09a9288b908576df 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>