#pragma once
-#include <config.h>
+#include <mem_config.h>
#ifdef __cplusplus
# include <cstddef>
#include <libmemcached/watchpoint.h>
#include <libmemcached/is.h>
-#include <libmemcached/instance.h>
+#ifdef __cplusplus
+# include "libmemcached/instance.hpp"
+#endif
#include <libmemcached/server_instance.h>
#ifdef HAVE_POLL_H
# include "poll/poll.h"
#endif
+#ifndef POLLHUP
+# define POLLHUP 0x0010
+#endif
+
+#ifndef POLLNVAL
+# define POLLNVAL 0x0020
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
memcached_return_t run_distribution(memcached_st *ptr);
-#define memcached_server_response_increment(A) (A)->cursor_active_++
+#ifdef __cplusplus
+static inline void memcached_server_response_increment(org::libmemcached::Instance* instance)
+{
+ instance->events(POLLIN);
+ instance->cursor_active_++;
+}
+#endif
+
#define memcached_server_response_decrement(A) (A)->cursor_active_--
#define memcached_server_response_reset(A) (A)->cursor_active_=0