X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=c7b84c94760d66ba97bb86cc833234abfc64e84e;hb=c2c9d14f605d54ec6e7d24551fdfa2ceee7d7258;hp=53e083a433cd45f6849d4479fb5301d1a3e12734;hpb=23dca174eef8d846e3d4402729b57f6ded035e64;p=awesomized%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index 53e083a4..c7b84c94 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -107,25 +107,24 @@ # include #endif +#if defined(WIN32) || defined(__MINGW32__) +# include "libmemcached/windows.hpp" +#endif + #include #include #include +typedef struct memcached_st Memcached; -#include +#ifdef __cplusplus +# include "libmemcached/instance.hpp" +#endif #include #ifdef HAVE_POLL_H # include #else -# include "poll/poll.h" -#endif - -#ifndef POLLHUP -# define POLLHUP 0x0010 -#endif - -#ifndef POLLNVAL -# define POLLNVAL 0x0020 +# include "libmemcached/poll.h" #endif #ifdef __cplusplus @@ -213,7 +212,14 @@ extern "C" { 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