From b4e92fd12d58e3baf3bc091114fcc57b88400544 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Thu, 21 Oct 2010 17:49:04 +0100 Subject: Pass "-ansi -pedantic" to gcc, so it tells us when we stray from C90 And fix up the resulting warnings We don't use "-ansi -pedantic" in the tools dir, because that code relies on libpopt, and so is unlikely ever to work with the Microsoft compiler anyway. --- librabbitmq/unix/socket.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'librabbitmq/unix') diff --git a/librabbitmq/unix/socket.c b/librabbitmq/unix/socket.c index 9d37dfc..4f5368e 100644 --- a/librabbitmq/unix/socket.c +++ b/librabbitmq/unix/socket.c @@ -53,6 +53,7 @@ #include #include #include +#include #include "amqp.h" #include "amqp_private.h" @@ -77,7 +78,13 @@ int amqp_socket_socket(int domain, int type, int proto) } return s; -} +} + +/* strdup is not in ISO C90! */ +static inline char *strdup(const char *str) +{ + return strcpy(malloc(strlen(str) + 1),str); +} char *amqp_os_error_string(int err) { -- cgit v1.2.1