diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2012-05-28 14:06:44 -0400 |
---|---|---|
committer | Michael Steinert <mike.steinert@gmail.com> | 2012-05-29 12:07:53 -0600 |
commit | ef7e32698b39b98eed1c0ac03b6223c8b620debf (patch) | |
tree | 4d1672c82cee21666965fd80c0a011634acba702 | |
parent | 637d6593884910e86dde8400b281dc87b4d568c3 (diff) | |
download | rabbitmq-c-github-ask-ef7e32698b39b98eed1c0ac03b6223c8b620debf.tar.gz |
Moving posix-specific inet includes to unix/socket.h
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | librabbitmq/amqp_socket.c | 12 | ||||
-rw-r--r-- | librabbitmq/unix/socket.h | 4 |
4 files changed, 7 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index aecbb2c..9f18495 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,23 +18,6 @@ if (STD_C99) set(CMAKE_C_FLAGS "-std=c99") endif (STD_C99) -include(CheckIncludeFiles) - -check_include_files("arpa/inet.h" HAVE_ARPA_INET_H) -if (HAVE_ARPA_INET_H) - add_definitions(-DHAVE_ARPA_INET_H) -endif (HAVE_ARPA_INET_H) - -check_include_files("netdb.h" HAVE_NETDB_H) -if (HAVE_NETDB_H) - add_definitions(-DHAVE_NETDB_H) -endif (HAVE_NETDB_H) - -check_include_files("netinet/tcp.h" HAVE_NETINET_TCP_H) -if (HAVE_NETINET_TCP_H) - add_definitions(-DHAVE_NETINET_TCP_H) -endif (HAVE_NETINET_TCP_H) - if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() diff --git a/configure.ac b/configure.ac index efad735..cfd93ef 100644 --- a/configure.ac +++ b/configure.ac @@ -35,9 +35,6 @@ PKG_PROG_PKG_CONFIG([0.17]) AC_CANONICAL_HOST AC_C_BIGENDIAN 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_socket.c b/librabbitmq/amqp_socket.c index 747ab8a..77897b4 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -35,21 +35,15 @@ #endif #include "amqp_private.h" + +#include "socket.h" + #include <assert.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #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) diff --git a/librabbitmq/unix/socket.h b/librabbitmq/unix/socket.h index 17dc1ec..ecff471 100644 --- a/librabbitmq/unix/socket.h +++ b/librabbitmq/unix/socket.h @@ -33,6 +33,10 @@ * ***** END LICENSE BLOCK ***** */ +#include <arpa/inet.h> +#include <netdb.h> +#include <netinet/tcp.h> +#include <sys/socket.h> #include <sys/uio.h> int |