Merge remote branch 'origin/collectd-4.8' into collectd-4.8
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 9 Mar 2010 15:55:20 +0000 (16:55 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 9 Mar 2010 15:55:20 +0000 (16:55 +0100)
configure.in
src/common.c
src/common.h
src/memcached.c

index 5daf533..f46a362 100644 (file)
@@ -906,6 +906,27 @@ if test "x$have_getmntent" = "xgen"; then
                  [Define if the function getmntent exists. It's the version from libgen.])
 fi
 
+# Check for htonll
+AC_MSG_CHECKING([if have htonll defined])
+
+    have_htonll="no"
+    AC_RUN_IFELSE([
+       AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h> 
+#endif
+       ], [
+          return htonll(0);
+       ])
+    ], [
+      have_htonll="yes"
+      AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
+    ])
+AC_MSG_RESULT([$have_htonll])
+
 # Check for structures
 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
        [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
index 7c2c30e..b9e41b1 100644 (file)
@@ -659,6 +659,7 @@ long long get_kstat_value (kstat_t *ksp, char *name)
 }
 #endif /* HAVE_LIBKSTAT */
 
+#ifndef HAVE_HTONLL
 unsigned long long ntohll (unsigned long long n)
 {
 #if BYTE_ORDER == BIG_ENDIAN
@@ -676,6 +677,7 @@ unsigned long long htonll (unsigned long long n)
        return (((unsigned long long) htonl (n)) << 32) + htonl (n >> 32);
 #endif
 } /* unsigned long long htonll */
+#endif /* HAVE_HTONLL */
 
 #if FP_LAYOUT_NEED_NOTHING
 /* Well, we need nothing.. */
index 6682e1c..8a9f335 100644 (file)
@@ -236,8 +236,10 @@ int get_kstat (kstat_t **ksp_ptr, char *module, int instance, char *name);
 long long get_kstat_value (kstat_t *ksp, char *name);
 #endif
 
+#ifndef HAVE_HTONLL
 unsigned long long ntohll (unsigned long long n);
 unsigned long long htonll (unsigned long long n);
+#endif
 
 #if FP_LAYOUT_NEED_NOTHING
 # define ntohd(d) (d)
index b332157..348591f 100644 (file)
 # include <netinet/in.h>
 # include <netinet/tcp.h>
 
+/* Hack to work around the missing define in AIX */
+#ifndef MSG_DONTWAIT
+# define MSG_DONTWAIT MSG_NONBLOCK
+#endif
+
 #define MEMCACHED_DEF_HOST "127.0.0.1"
 #define MEMCACHED_DEF_PORT "11211"