From 25ce52e4492d286a2d99df7ba401fe7fb344d9c5 Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Fri, 12 Feb 2016 11:01:52 +0100 Subject: [PATCH] Problem: tcp_address.cpp has messy include usage It's all over the place. Solution: remove duplicates and try to move main includes to start of source. Also, include net/if.h always, so that the code will compile if ZMQ_HAVE_IFADDRS isn't defined. --- src/tcp_address.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/tcp_address.cpp b/src/tcp_address.cpp index 73770b97..e896b37a 100644 --- a/src/tcp_address.cpp +++ b/src/tcp_address.cpp @@ -32,27 +32,23 @@ #include "macros.hpp" #include "tcp_address.hpp" -#include "platform.hpp" #include "stdint.hpp" #include "err.hpp" #include "ip.hpp" -#ifdef ZMQ_HAVE_WINDOWS -#include "windows.hpp" -#else +#ifndef ZMQ_HAVE_WINDOWS #include #include #include +#include #include #include +#include +#include #endif #ifdef ZMQ_HAVE_SOLARIS - #include -#include -#include -#include // On Solaris platform, network interface name can be queried by ioctl. int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) @@ -116,11 +112,7 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_ } #elif defined ZMQ_HAVE_AIX || defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_ANDROID - -#include -#include #include -#include int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) { @@ -182,7 +174,6 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_ && defined ZMQ_HAVE_IFADDRS) #include -#include // On these platforms, network interface name can be queried // using getifaddrs function.