mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
Merge pull request #418 from teemu-kemppainen/develop
Using #include <linux/if.h> conflicts with other libraries and code that use #include <net/if.h>
This commit is contained in:
commit
b1bdf7f34c
@ -169,16 +169,9 @@
|
|||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#if defined(POCO_OS_FAMILY_UNIX)
|
#if defined(POCO_OS_FAMILY_UNIX)
|
||||||
#if (POCO_OS == POCO_OS_LINUX)
|
#if (POCO_OS == POCO_OS_LINUX)
|
||||||
// <linux/if.h> is needed by NetworkInterface for ifmap, ifreq and ifconf definitions
|
// Net/src/NetworkInterface.cpp changed #include <linux/if.h> to #include <net/if.h>
|
||||||
#include <linux/if.h>
|
// no more conflict, can use #include <net/if.h> here
|
||||||
// if_nametoindex and if_indextoname are needed by IPAddress and NetworkInterface
|
#include <net/if.h>
|
||||||
// we can't get them from <net/if.h> because of a conflict with <linux/if.h>, 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;
|
|
||||||
}
|
|
||||||
#elif (POCO_OS == POCO_OS_HPUX)
|
#elif (POCO_OS == POCO_OS_HPUX)
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -1369,7 +1369,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
|||||||
#ifndef POCO_ANDROID // Android doesn't have <ifaddrs.h>
|
#ifndef POCO_ANDROID // Android doesn't have <ifaddrs.h>
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#endif
|
#endif
|
||||||
#include <linux/if.h>
|
#include <net/if.h>
|
||||||
#include <linux/if_packet.h>
|
#include <linux/if_packet.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
Loading…
Reference in New Issue
Block a user