mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 09:12:28 +02:00
- Android compile fixes
This commit is contained in:
@@ -69,10 +69,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// compile-time shield against misalignment
|
// compile-time shield against misalignment
|
||||||
|
#ifndef POCO_ANDROID
|
||||||
poco_static_assert (offsetof(Header, code) == 0x01);
|
poco_static_assert (offsetof(Header, code) == 0x01);
|
||||||
poco_static_assert (offsetof(Header, checksum) == 0x02);
|
poco_static_assert (offsetof(Header, checksum) == 0x02);
|
||||||
poco_static_assert (offsetof(Header, id) == 0x04);
|
poco_static_assert (offsetof(Header, id) == 0x04);
|
||||||
poco_static_assert (offsetof(Header, seq) == 0x06);
|
poco_static_assert (offsetof(Header, seq) == 0x06);
|
||||||
|
#endif
|
||||||
|
|
||||||
enum MessageType
|
enum MessageType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,6 +39,16 @@
|
|||||||
#ifndef Net_SocketDefs_INCLUDED
|
#ifndef Net_SocketDefs_INCLUDED
|
||||||
#define Net_SocketDefs_INCLUDED
|
#define Net_SocketDefs_INCLUDED
|
||||||
|
|
||||||
|
#ifndef __THROW
|
||||||
|
# ifndef __GNUC_PREREQ
|
||||||
|
# define __GNUC_PREREQ(maj, min) (0)
|
||||||
|
# endif
|
||||||
|
# if defined __cplusplus && __GNUC_PREREQ (2,8)
|
||||||
|
# define __THROW throw ()
|
||||||
|
# else
|
||||||
|
# define __THROW
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
#include "Poco/UnWindows.h"
|
#include "Poco/UnWindows.h"
|
||||||
|
|||||||
@@ -1276,7 +1276,9 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
|||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#ifndef POCO_ANDROID // Android doesn't have <ifaddrs.h>
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
|
#endif
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#include <linux/if_packet.h>
|
#include <linux/if_packet.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
@@ -1306,6 +1308,8 @@ static NetworkInterface::Type fromNative(unsigned arphrd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef POCO_ANDROID
|
||||||
|
|
||||||
void setInterfaceParams(struct ifaddrs* iface, NetworkInterfaceImpl& impl)
|
void setInterfaceParams(struct ifaddrs* iface, NetworkInterfaceImpl& impl)
|
||||||
{
|
{
|
||||||
struct sockaddr_ll* sdl = (struct sockaddr_ll*) iface->ifa_addr;
|
struct sockaddr_ll* sdl = (struct sockaddr_ll*) iface->ifa_addr;
|
||||||
@@ -1317,11 +1321,14 @@ void setInterfaceParams(struct ifaddrs* iface, NetworkInterfaceImpl& impl)
|
|||||||
impl.setType(fromNative(sdl->sll_hatype));
|
impl.setType(fromNative(sdl->sll_hatype));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
||||||
{
|
{
|
||||||
|
#ifndef POCO_ANDROID
|
||||||
FastMutex::ScopedLock lock(_mutex);
|
FastMutex::ScopedLock lock(_mutex);
|
||||||
Map result;
|
Map result;
|
||||||
unsigned ifIndex = 0;
|
unsigned ifIndex = 0;
|
||||||
@@ -1420,6 +1427,9 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
|||||||
if (ifaces) freeifaddrs(ifaces);
|
if (ifaces) freeifaddrs(ifaces);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
#else
|
||||||
|
throw Poco::NotImplementedException("Not implemented in Android");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user