summaryrefslogtreecommitdiff
path: root/librabbitmq/unix
diff options
context:
space:
mode:
authorDavid Wragg <david@rabbitmq.com>2010-10-21 17:49:04 +0100
committerDavid Wragg <david@rabbitmq.com>2010-10-21 17:49:04 +0100
commitb4e92fd12d58e3baf3bc091114fcc57b88400544 (patch)
treea50d4047f6f192e4006764b7e43fe1410b59d961 /librabbitmq/unix
parente8ddb5e6758dcb888d1f6aef754a33fd7ba7a2cb (diff)
downloadrabbitmq-c-b4e92fd12d58e3baf3bc091114fcc57b88400544.tar.gz
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.
Diffstat (limited to 'librabbitmq/unix')
-rw-r--r--librabbitmq/unix/socket.c9
1 files changed, 8 insertions, 1 deletions
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 <fcntl.h>
#include <stdint.h>
#include <string.h>
+#include <stdlib.h>
#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)
{