diff options
author | David Wragg <david@rabbitmq.com> | 2010-10-21 17:49:04 +0100 |
---|---|---|
committer | David Wragg <david@rabbitmq.com> | 2010-10-21 17:49:04 +0100 |
commit | ceda8246d3fe0ceb51f680848c8cbe45c332f71a (patch) | |
tree | 230ced98a3e83f94c37303f0f03d3f1177eb180f /librabbitmq/amqp_api.c | |
parent | 0d25d02e769dca4ced51580a7d47061717da2bec (diff) | |
download | rabbitmq-c-ceda8246d3fe0ceb51f680848c8cbe45c332f71a.tar.gz |
Eliminate the amqp_assert macro
It relied on gccisms. Replace it with a amqp_abort function.
Diffstat (limited to 'librabbitmq/amqp_api.c')
-rw-r--r-- | librabbitmq/amqp_api.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c index b2793ff..25b855f 100644 --- a/librabbitmq/amqp_api.c +++ b/librabbitmq/amqp_api.c @@ -52,6 +52,7 @@ #include <stdio.h> #include <string.h> #include <stdint.h> +#include <stdarg.h> #include "amqp.h" #include "amqp_framing.h" @@ -93,6 +94,18 @@ char *amqp_error_string(int err) return strdup(str); } +void amqp_abort(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fputc('\n', stderr); + abort(); +} + + + #define RPC_REPLY(replytype) \ (state->most_recent_api_result.reply_type == AMQP_RESPONSE_NORMAL \ ? (replytype *) state->most_recent_api_result.reply.decoded \ |