diff options
author | Daniel Schauenberg <d@unwiredcouch.com> | 2011-02-03 12:44:16 +0100 |
---|---|---|
committer | Daniel Schauenberg <d@unwiredcouch.com> | 2011-02-03 12:44:16 +0100 |
commit | 28c3b9b263da5d7167e5bf124c98b274b041617c (patch) | |
tree | 8d7ab316edb019768b8abd43c266fa18084f27c9 | |
parent | baa6cd4c79d7118f0c1f938d9016dbe83afc8089 (diff) | |
download | rabbitmq-c-github-ask-28c3b9b263da5d7167e5bf124c98b274b041617c.tar.gz |
config.h defines _GNU_SOURCE and is therefore all we need to include
-rw-r--r-- | librabbitmq/amqp_api.c | 6 | ||||
-rw-r--r-- | librabbitmq/unix/socket.c | 6 | ||||
-rw-r--r-- | librabbitmq/utils/strdup.h | 10 | ||||
-rw-r--r-- | librabbitmq/windows/socket.c | 6 |
4 files changed, 6 insertions, 22 deletions
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c index e35fa2d..d3baf5a 100644 --- a/librabbitmq/amqp_api.c +++ b/librabbitmq/amqp_api.c @@ -48,6 +48,8 @@ * ***** END LICENSE BLOCK ***** */ +#include "config.h" + #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -58,10 +60,6 @@ #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] = { diff --git a/librabbitmq/unix/socket.c b/librabbitmq/unix/socket.c index 1edc52f..b8f0b4e 100644 --- a/librabbitmq/unix/socket.c +++ b/librabbitmq/unix/socket.c @@ -48,6 +48,8 @@ * ***** END LICENSE BLOCK ***** */ +#include "config.h" + #include <sys/socket.h> #include <unistd.h> #include <fcntl.h> @@ -59,10 +61,6 @@ #include "amqp_private.h" #include "socket.h" -#ifndef _GNU_SOURCE -#include "utils/strdup.h" -#endif - int amqp_socket_socket(int domain, int type, int proto) { int flags; diff --git a/librabbitmq/utils/strdup.h b/librabbitmq/utils/strdup.h deleted file mode 100644 index 4478cbd..0000000 --- a/librabbitmq/utils/strdup.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef librabbitmq_strdup_h -#define librabbitmq_strdup_h -/* strdup is not in ISO C90! - * we define it here for easy inclusion - */ -static inline char *strdup(const char *str) -{ - return strcpy(malloc(strlen(str) + 1),str); -} -#endif diff --git a/librabbitmq/windows/socket.c b/librabbitmq/windows/socket.c index 57914b1..0133a8c 100644 --- a/librabbitmq/windows/socket.c +++ b/librabbitmq/windows/socket.c @@ -51,6 +51,8 @@ /* See http://msdn.microsoft.com/en-us/library/ms737629%28VS.85%29.aspx */ #define WIN32_LEAN_AND_MEAN +#include "config.h" + #include <windows.h> #include <stdint.h> #include <stdlib.h> @@ -59,10 +61,6 @@ #include "amqp_private.h" #include "socket.h" -#ifndef _GNU_SOURCE -#include "utils/strdup.h" -#endif - static int called_wsastartup; int amqp_socket_init(void) |