X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=d4b2c7df3446660f26307541ec29a3560068767d;hb=8368c501914b1a6fcd722395d07879bad65c540d;hp=ac300def96249c7c1296be9edefe8f9b1201fb51;hpb=7abcaebdc4c3dd11b779eaef58a7371fb82ae888;p=awesomized%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index ac300def..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 @@ -164,20 +169,24 @@ LIBMEMCACHED_LOCAL 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;