X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=d4b2c7df3446660f26307541ec29a3560068767d;hb=0a45c8bafd621482cb08f2e5f792f42cafb13865;hp=46230ce3169585f7a6c6f029e3dcecee022656e5;hpb=9cd57ce737375540f6c3b5e2e3684160e5c4bfce;p=m6w6%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index 46230ce3..d4b2c7df 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -102,6 +102,11 @@ memcached_return_t memcached_server_execute(memcached_st *ptr, #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;