diff options
Diffstat (limited to 'librabbitmq/windows/socket.c')
-rw-r--r-- | librabbitmq/windows/socket.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/librabbitmq/windows/socket.c b/librabbitmq/windows/socket.c index 3cc57ba..bef7b95 100644 --- a/librabbitmq/windows/socket.c +++ b/librabbitmq/windows/socket.c @@ -53,6 +53,7 @@ #include <windows.h> #include <stdint.h> +#include <stdlib.h> #include "amqp.h" #include "amqp_private.h" @@ -67,13 +68,19 @@ int amqp_socket_init(void) int res = WSAStartup(0x0202, &data); if (res) return -res; - + called_wsastartup = 1; } return 0; } +/* 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) { char *msg, *copy; |