From 7de3349b57bfebb7bf7bf330064dfae2d1b98bf6 Mon Sep 17 00:00:00 2001 From: Teemu Kemppainen Date: Thu, 3 Apr 2014 16:36:29 +0300 Subject: [PATCH] Changed #include to #include Including linux/if.h instead of net/if.h causes conflicts with applications that use net/if.h. --- Net/include/Poco/Net/SocketDefs.h | 13 +++---------- Net/src/NetworkInterface.cpp | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Net/include/Poco/Net/SocketDefs.h b/Net/include/Poco/Net/SocketDefs.h index ab3f6daa3..8d963ae77 100644 --- a/Net/include/Poco/Net/SocketDefs.h +++ b/Net/include/Poco/Net/SocketDefs.h @@ -169,16 +169,9 @@ #include #if defined(POCO_OS_FAMILY_UNIX) #if (POCO_OS == POCO_OS_LINUX) - // is needed by NetworkInterface for ifmap, ifreq and ifconf definitions - #include - // if_nametoindex and if_indextoname are needed by IPAddress and NetworkInterface - // we can't get them from because of a conflict with , so - // we declare them here - extern "C" - { - extern unsigned int if_nametoindex (__const char *__ifname) __THROW; - extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW; - } + // Net/src/NetworkInterface.cpp changed #include to #include + // no more conflict, can use #include here + #include #elif (POCO_OS == POCO_OS_HPUX) extern "C" { diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index c84e2d6df..daa4d4809 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -1369,7 +1369,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) #ifndef POCO_ANDROID // Android doesn't have #include #endif -#include +#include #include #include #include