diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | librabbitmq/amqp-openssl.c | 1 | ||||
-rw-r--r-- | librabbitmq/amqp_private.h | 5 | ||||
-rw-r--r-- | librabbitmq/amqp_socket.c | 11 |
4 files changed, 15 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index c2e8d09..dcb255f 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,9 @@ PKG_PROG_PKG_CONFIG([0.17]) # Environment setup AC_CANONICAL_HOST AC_C_INLINE +AC_CHECK_HEADERS([arpa/inet.h]) +AC_CHECK_HEADERS([netdb.h]) +AC_CHECK_HEADERS([netinet/tcp.h]) # Set compiler flags AX_TRY_CFLAGS([-Wall], [AX_CFLAGS([-Wall])]) diff --git a/librabbitmq/amqp-openssl.c b/librabbitmq/amqp-openssl.c index d15bb6b..4e32b73 100644 --- a/librabbitmq/amqp-openssl.c +++ b/librabbitmq/amqp-openssl.c @@ -31,7 +31,6 @@ #include <openssl/err.h> #include <openssl/ssl.h> #include <stdlib.h> -#include <unistd.h> struct amqp_ssl_socket_context { BIO *bio; diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index e362ed6..7c77af8 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -43,9 +43,12 @@ #include "amqp.h" #include "amqp_framing.h" -#include <arpa/inet.h> #include <string.h> +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif + /* Error numbering: Because of differences in error numbering on * different platforms, we want to keep error numbers opaque for * client code. Internally, we encode the category of an error diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index f57a512..69fd346 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -40,9 +40,6 @@ #include "amqp_private.h" #include <assert.h> -#include <netdb.h> -#include <netinet/in.h> -#include <netinet/tcp.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> @@ -50,6 +47,14 @@ #include <string.h> #include <sys/socket.h> +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif + +#ifdef HAVE_NETINET_TCP_H +#include <netinet/tcp.h> +#endif + int amqp_open_socket(char const *hostname, int portnumber) { |