/*
+--------------------------------------------------------------------+
- | 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. |
| the terms online at: https://opensource.org/licenses/BSD-3-Clause |
+--------------------------------------------------------------------+
| Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
- | Copyright (c) 2020 Michael Wallner <mike@php.net> |
+ | Copyright (c) 2020-2021 Michael Wallner https://awesome.co/ |
+--------------------------------------------------------------------+
*/
# include <dlfcn.h>
#endif
-#include "libmemcached-1/memcached.h"
+#include "libmemcached-1.0/memcached.h"
#include "libmemcached/watchpoint.h"
#include "libmemcached/is.h"
typedef struct memcached_st Memcached;
#include "libmemcached/io.h"
#ifdef __cplusplus
# include "libmemcached/string.hpp"
-# include "libmemcachedprotocol-0/binary.h"
+# include "libmemcachedprotocol-0.0/binary.h"
# include "libmemcached/io.hpp"
# include "libmemcached/udp.hpp"
# include "libmemcached/do.hpp"
}
#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