diff options
author | Tony Garnock-Jones <tonyg@kcbbs.gen.nz> | 2009-05-12 00:28:25 +0100 |
---|---|---|
committer | Tony Garnock-Jones <tonyg@kcbbs.gen.nz> | 2009-05-12 00:28:25 +0100 |
commit | a67c844cdb231f910e43b1709214186b1b1e57bf (patch) | |
tree | 2a913d40b3dac4be3eae98b7957150c714308e86 | |
parent | f336bb896dce573d39db0460c4ca4ff75fc8bda9 (diff) | |
download | rabbitmq-c-github-ask-a67c844cdb231f910e43b1709214186b1b1e57bf.tar.gz |
New AMQP_BYTES_FREE macro.
-rw-r--r-- | librabbitmq/amqp.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 59d5466..6c9773f 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -128,6 +128,14 @@ extern void amqp_pool_alloc_bytes(amqp_pool_t *pool, size_t amount, amqp_bytes_t extern amqp_bytes_t amqp_cstring_bytes(char const *cstr); extern amqp_bytes_t amqp_bytes_malloc_dup(amqp_bytes_t src); +#define AMQP_BYTES_FREE(b) \ + ({ \ + if ((b).bytes != NULL) { \ + free((b).bytes); \ + (b).bytes = NULL; \ + } \ + }) + extern amqp_connection_state_t amqp_new_connection(void); extern void amqp_set_sockfd(amqp_connection_state_t state, int sockfd); |