X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibmemcached%2Fcommon.h;h=ed12d617fad5d74424b9caceaa21b6e19d5e1d8a;hb=c8c52cf24f50f55454ba36250fd54b848d6d9ce2;hp=e79a976845882c8dccc42f868ee29ff1f1101b61;hpb=e4dc06e9f89a6aa678e2973898ae75faa80bc0c2;p=awesomized%2Flibmemcached diff --git a/src/libmemcached/common.h b/src/libmemcached/common.h index e79a9768..ed12d617 100644 --- a/src/libmemcached/common.h +++ b/src/libmemcached/common.h @@ -1,6 +1,6 @@ /* +--------------------------------------------------------------------+ - | libmemcached - C/C++ Client Library for memcached | + | libmemcached-awesome - C/C++ Client Library for memcached | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted under the terms of the BSD license. | @@ -140,11 +140,21 @@ static inline void memcached_server_response_increment(memcached_instance_st *in } #endif -#define memcached_server_response_decrement(A) (A)->cursor_active_-- -#define memcached_server_response_reset(A) (A)->cursor_active_ = 0 +#define memcached_server_response_decrement(A) do { \ + WATCHPOINT_ASSERT((A)->cursor_active_ > 0); \ + if ((A)->cursor_active_ > 0) { \ + (A)->cursor_active_--; \ + } \ +} while (0) +#define memcached_server_response_reset(A) (A)->cursor_active_ = 0 #define memcached_instance_response_increment(A) (A)->cursor_active_++ -#define memcached_instance_response_decrement(A) (A)->cursor_active_-- +#define memcached_instance_response_decrement(A) do { \ + WATCHPOINT_ASSERT((A)->cursor_active_ > 0); \ + if ((A)->cursor_active_ > 0) { \ + (A)->cursor_active_--; \ + } \ +} while (0) #define memcached_instance_response_reset(A) (A)->cursor_active_ = 0 #ifdef __cplusplus