X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=c7b84c94760d66ba97bb86cc833234abfc64e84e;hb=326e812b0ca940bf90aaadf69312a0316091d0cb;hp=5c86eb16e01967360ccf3bef583e7a35cf66fb84;hpb=8e04e2a97ba16fce9ebf7d47a944de2dc40ba453;p=awesomized%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index 5c86eb16..c7b84c94 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -42,64 +42,89 @@ #pragma once -#include +#include #ifdef __cplusplus -# include -# include -# include -# include -# include -# include -# include +# include +# include +# include +# include +# include +# include +# include +# include #else -# ifdef HAVE_STDLIB_H -# include -# endif -# ifdef HAVE_STDLIB_H -# include -# endif -# include +# ifdef HAVE_STDDEF_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# include +# ifdef HAVE_TIME_H # include -# ifdef HAVE_ERRNO_H -# include -# endif -# ifdef HAVE_LIMITS_H -# include -# endif +# endif +# ifdef HAVE_ERRNO_H +# include +# endif +# ifdef HAVE_LIMITS_H +# include +# endif +#endif + +#ifdef HAVE_SYS_UN_H +# include +#endif + +#ifdef HAVE_SYS_TIME_H +# include #endif #ifdef HAVE_FCNTL_H -# include +# include #endif #ifdef HAVE_SYS_TYPES_H -# include +# include #endif #ifdef HAVE_UNISTD_H -# include +# include +#endif + +#ifdef HAVE_SYS_SOCKET_H +# include #endif #ifdef HAVE_STRINGS_H -# include +# include #endif #ifdef HAVE_DLFCN_H -# include +# 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" +# include "libmemcached/poll.h" #endif #ifdef __cplusplus @@ -187,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