X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=d4b2c7df3446660f26307541ec29a3560068767d;hb=a0fafc525fa32971cca3811bbb1655fa25425c95;hp=98072cb3138d4266994173ff4d59b63e1eadd838;hpb=d8dedbd561c7cb57daf4192fe57ce5e205bcadd7;p=m6w6%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index 98072cb3..d4b2c7df 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -100,7 +100,12 @@ memcached_return_t memcached_server_execute(memcached_st *ptr, #include #include #include -#include +#include + +#ifdef __cplusplus +#include +#include +#endif /* string value */ struct memcached_continuum_item_st @@ -154,30 +159,34 @@ LIBMEMCACHED_LOCAL memcached_return_t memcached_purge(memcached_server_write_instance_st ptr); LIBMEMCACHED_LOCAL -memcached_server_st *memcached_server_create_with(const memcached_st *memc, - memcached_server_write_instance_st host, - const char *hostname, - in_port_t port, - uint32_t weight, - memcached_connection_t type); + memcached_server_st *__server_create_with(const memcached_st *memc, + memcached_server_write_instance_st host, + const char *hostname, + in_port_t port, + uint32_t weight, + memcached_connection_t type); static inline memcached_return_t memcached_validate_key_length(size_t key_length, bool binary) { - unlikely (key_length == 0) + if (key_length == 0) { return MEMCACHED_BAD_KEY_PROVIDED; } if (binary) { - unlikely (key_length > 0xffff) + if (key_length > 0xffff) + { return MEMCACHED_BAD_KEY_PROVIDED; + } } else { - unlikely (key_length >= MEMCACHED_MAX_KEY) + if (key_length >= MEMCACHED_MAX_KEY) + { return MEMCACHED_BAD_KEY_PROVIDED; + } } return MEMCACHED_SUCCESS;