diff options
Diffstat (limited to 'librabbitmq/amqp_api.c')
-rw-r--r-- | librabbitmq/amqp_api.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c index 37f6605..e35fa2d 100644 --- a/librabbitmq/amqp_api.c +++ b/librabbitmq/amqp_api.c @@ -58,6 +58,10 @@ #include "amqp_framing.h" #include "amqp_private.h" +#ifndef _GNU_SOURCE +#include "utils/strdup.h" +#endif + #include <assert.h> static const char *client_error_strings[ERROR_MAX] = { @@ -70,12 +74,6 @@ static const char *client_error_strings[ERROR_MAX] = { "connection closed unexpectedly", /* ERROR_CONNECTION_CLOSED */ }; -/* strdup is not in ISO C90! */ -static inline char *strdup(const char *str) -{ - return strcpy(malloc(strlen(str) + 1),str); -} - char *amqp_error_string(int err) { const char *str; @@ -92,7 +90,7 @@ char *amqp_error_string(int err) case ERROR_CATEGORY_OS: return amqp_os_error_string(err); - + default: str = "(undefined error category)"; } |