Merge branch 'collectd-4.2' into collectd-4.3
[collectd.git] / src / collectd.h
index e1ce97c..59dc5d2 100644 (file)
@@ -23,7 +23,7 @@
 #define COLLECTD_H
 
 #if HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include <stdio.h>
 /* #endif NAN_STATIC_ISOC */
 #elif NAN_ZERO_ZERO
 # include <math.h>
+# ifdef NAN
+#  undef NAN
+# endif
 # define NAN (0.0 / 0.0)
 # ifndef isnan
 #  define isnan(f) ((f) != (f))
 # endif /* !defined(isnan) */
 #endif /* NAN_ZERO_ZERO */
 
+#if HAVE_ENDIAN_H
+# include <endian.h>
+#endif
+
+#ifndef BYTE_ORDER
+# ifdef __BYTE_ORDER
+#  define BYTE_ORDER __BYTE_ORDER
+# endif
+#endif
+#ifndef BIG_ENDIAN
+# ifdef __BIG_ENDIAN
+#  define BIG_ENDIAN __BIG_ENDIAN
+# endif
+#endif
+#if !defined(BYTE_ORDER) || !defined(BIG_ENDIAN)
+# error "Cannot determine byte order"
+#endif
+
 #if HAVE_DIRENT_H
 # include <dirent.h>
 # define NAMLEN(dirent) strlen((dirent)->d_name)
 # include <kstat.h>
 #endif
 
-#if HAVE_RRD_H
-# include <rrd.h>
-#endif
 #if HAVE_PTH_H
 # include <pth.h>
 #endif
 #define CONFIGFILE SYSCONFDIR"/collectd.conf"
 #endif
 
+#ifndef LOCALSTATEDIR
+#define LOCALSTATEDIR PREFIX "/var"
+#endif
+
 #ifndef PKGLOCALSTATEDIR
 #define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
 #endif
 #define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
 #endif
 
-#define MODE_SERVER 0x01
-#define MODE_CLIENT 0x02
-#define MODE_LOCAL  0x04
-#define MODE_LOG    0x08
-
 #ifndef COLLECTD_GRP_NAME
 # define COLLECTD_GRP_NAME "collectd"
 #endif