mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
Add POCO_OS_ANDROID as platfrom definitons (#2186)
* Add POCO_OS_ANDROID as platform definition * Ignore test big ping when its failing
This commit is contained in:
parent
9feabc7723
commit
73897b4357
@ -25,7 +25,7 @@
|
||||
#include "Poco/NamedEvent_WIN32U.h"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#include "Poco/NamedEvent_WIN32.h"
|
||||
#elif defined(POCO_ANDROID)
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#include "Poco/NamedEvent_Android.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#include "Poco/NamedEvent_UNIX.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "Poco/NamedMutex_WIN32U.h"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#include "Poco/NamedMutex_WIN32.h"
|
||||
#elif defined(POCO_ANDROID)
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#include "Poco/NamedMutex_Android.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#include "Poco/NamedMutex_UNIX.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#define POCO_OS_VXWORKS 0x000c
|
||||
#define POCO_OS_CYGWIN 0x000d
|
||||
#define POCO_OS_NACL 0x000e
|
||||
#define POCO_OS_ANDROID 0x000f
|
||||
#define POCO_OS_UNKNOWN_UNIX 0x00ff
|
||||
#define POCO_OS_WINDOWS_NT 0x1001
|
||||
#define POCO_OS_WINDOWS_CE 0x1011
|
||||
@ -62,7 +63,11 @@
|
||||
#define POCO_OS POCO_OS_NACL
|
||||
#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__TOS_LINUX__) || defined(EMSCRIPTEN)
|
||||
#define POCO_OS_FAMILY_UNIX 1
|
||||
#define POCO_OS POCO_OS_LINUX
|
||||
#if defined(__ANDROID__)
|
||||
#define POCO_OS POCO_OS_ANDROID
|
||||
#else
|
||||
#define POCO_OS POCO_OS_LINUX
|
||||
#endif
|
||||
#elif defined(__APPLE__) || defined(__TOS_MACOS__)
|
||||
#define POCO_OS_FAMILY_UNIX 1
|
||||
#define POCO_OS_FAMILY_BSD 1
|
||||
|
@ -28,7 +28,7 @@
|
||||
#else
|
||||
#include "Poco/RWLock_WIN32.h"
|
||||
#endif
|
||||
#elif defined(POCO_ANDROID)
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#include "Poco/RWLock_Android.h"
|
||||
#elif defined(POCO_VXWORKS)
|
||||
#include "Poco/RWLock_VX.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "Poco/Event.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Buffer.h"
|
||||
#if POCO_OS == POCO_OS_LINUX
|
||||
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
||||
#include <sys/inotify.h>
|
||||
#include <sys/select.h>
|
||||
#include <unistd.h>
|
||||
@ -252,7 +252,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#elif POCO_OS == POCO_OS_LINUX
|
||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
||||
|
||||
|
||||
class LinuxDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
||||
@ -572,7 +572,7 @@ void DirectoryWatcher::init()
|
||||
|
||||
#if POCO_OS == POCO_OS_WINDOWS_NT
|
||||
_pStrategy = new WindowsDirectoryWatcherStrategy(*this);
|
||||
#elif POCO_OS == POCO_OS_LINUX
|
||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
||||
_pStrategy = new LinuxDirectoryWatcherStrategy(*this);
|
||||
#elif POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD
|
||||
_pStrategy = new BSDDirectoryWatcherStrategy(*this);
|
||||
|
@ -177,7 +177,7 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#elif defined(__CYGWIN__) || POCO_OS == POCO_OS_LINUX
|
||||
#elif defined(__CYGWIN__) || POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
||||
//
|
||||
// Linux, Cygwin
|
||||
//
|
||||
|
@ -68,7 +68,7 @@ namespace Poco {
|
||||
{
|
||||
_buffer[0] = 0;
|
||||
|
||||
#if (_XOPEN_SOURCE >= 600) || POCO_ANDROID || __APPLE__
|
||||
#if (_XOPEN_SOURCE >= 600) || POCO_OS == POCO_OS_ANDROID || __APPLE__
|
||||
setMessage(strerror_r(err, _buffer, sizeof(_buffer)));
|
||||
#elif _GNU_SOURCE
|
||||
setMessage(strerror_r(err, _buffer, sizeof(_buffer)));
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "NamedEvent_WIN32U.cpp"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#include "NamedEvent_WIN32.cpp"
|
||||
#elif defined(POCO_ANDROID)
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#include "NamedEvent_Android.cpp"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#include "NamedEvent_UNIX.cpp"
|
||||
|
@ -31,7 +31,7 @@
|
||||
namespace Poco {
|
||||
|
||||
|
||||
#if (POCO_OS == POCO_OS_LINUX) || (POCO_OS == POCO_OS_CYGWIN) || (POCO_OS == POCO_OS_FREE_BSD)
|
||||
#if (POCO_OS == POCO_OS_LINUX) || (POCO_OS == POCO_OS_ANDROID) || (POCO_OS == POCO_OS_CYGWIN) || (POCO_OS == POCO_OS_FREE_BSD)
|
||||
union semun
|
||||
{
|
||||
int val;
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "NamedMutex_WIN32U.cpp"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#include "NamedMutex_WIN32.cpp"
|
||||
#elif defined(POCO_ANDROID)
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#include "NamedMutex_Android.cpp"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#include "NamedMutex_UNIX.cpp"
|
||||
|
@ -31,7 +31,7 @@
|
||||
namespace Poco {
|
||||
|
||||
|
||||
#if (POCO_OS == POCO_OS_LINUX) || (POCO_OS == POCO_OS_CYGWIN) || (POCO_OS == POCO_OS_FREE_BSD)
|
||||
#if (POCO_OS == POCO_OS_LINUX) || (POCO_OS == POCO_OS_ANDROID) || (POCO_OS == POCO_OS_CYGWIN) || (POCO_OS == POCO_OS_FREE_BSD)
|
||||
union semun
|
||||
{
|
||||
int val;
|
||||
|
@ -21,7 +21,7 @@
|
||||
#else
|
||||
#include "RWLock_WIN32.cpp"
|
||||
#endif
|
||||
#elif defined(POCO_ANDROID)
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#include "RWLock_Android.cpp"
|
||||
#elif defined(POCO_VXWORKS)
|
||||
#include "RWLock_VX.cpp"
|
||||
|
@ -24,7 +24,7 @@
|
||||
# define __EXTENSIONS__
|
||||
# endif
|
||||
#endif
|
||||
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_QNX
|
||||
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_QNX
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
@ -274,7 +274,7 @@ void ThreadImpl::sleepImpl(long milliseconds)
|
||||
interval.tv_sec = milliseconds / 1000;
|
||||
interval.tv_nsec = (milliseconds % 1000)*1000000;
|
||||
pthread_delay_np(&interval);
|
||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_QNX || POCO_OS == POCO_OS_VXWORKS
|
||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_QNX || POCO_OS == POCO_OS_VXWORKS
|
||||
Poco::Timespan remainingTime(1000*Poco::Timespan::TimeDiff(milliseconds));
|
||||
int rc;
|
||||
do
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
{
|
||||
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || defined(POCO_ANDROID) // no timezone global var
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || POCO_OS == POCO_OS_ANDROID // no timezone global var
|
||||
std::time_t now = std::time(NULL);
|
||||
struct std::tm t;
|
||||
gmtime_r(&now, &t);
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
};
|
||||
|
||||
// compile-time shield against misalignment
|
||||
#ifndef POCO_ANDROID
|
||||
#ifndef POCO_OS == POCO_OS_ANDROID
|
||||
poco_static_assert (offsetof(Header, code) == 0x01);
|
||||
poco_static_assert (offsetof(Header, checksum) == 0x02);
|
||||
poco_static_assert (offsetof(Header, id) == 0x04);
|
||||
|
@ -114,7 +114,7 @@ POCO_NET_FORCE_SYMBOL(pocoNetworkInitializer)
|
||||
//
|
||||
// Define POCO_NET_HAS_INTERFACE for platforms that have network interface detection implemented.
|
||||
//
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) || (POCO_OS == POCO_OS_LINUX) || defined(POCO_OS_FAMILY_BSD) || (POCO_OS == POCO_OS_SOLARIS) || (POCO_OS == POCO_OS_QNX)
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) || (POCO_OS == POCO_OS_LINUX) || POCO_OS == (POCO_OS_ANDROID) || defined(POCO_OS_FAMILY_BSD) || (POCO_OS == POCO_OS_SOLARIS) || (POCO_OS == POCO_OS_QNX)
|
||||
#define POCO_NET_HAS_INTERFACE
|
||||
#endif
|
||||
|
||||
|
@ -143,7 +143,7 @@
|
||||
#include <netinet/tcp.h>
|
||||
#include <netdb.h>
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
#if (POCO_OS == POCO_OS_LINUX)
|
||||
#if (POCO_OS == POCO_OS_LINUX) || (POCO_OS == POCO_OS_ANDROID)
|
||||
// Net/src/NetworkInterface.cpp changed #include <linux/if.h> to #include <net/if.h>
|
||||
// no more conflict, can use #include <net/if.h> here
|
||||
#include <net/if.h>
|
||||
|
@ -1511,14 +1511,14 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
||||
} } // namespace Poco::Net
|
||||
|
||||
|
||||
#elif POCO_OS == POCO_OS_LINUX
|
||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
||||
//
|
||||
// Linux
|
||||
//
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef POCO_ANDROID // Android doesn't have <ifaddrs.h>
|
||||
#if POCO_OS != POCO_OS_ANDROID // Android doesn't have <ifaddrs.h>
|
||||
#include <ifaddrs.h>
|
||||
#endif
|
||||
#include <net/if.h>
|
||||
@ -1553,7 +1553,7 @@ static NetworkInterface::Type fromNative(unsigned arphrd)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef POCO_ANDROID
|
||||
#if POCO_OS != POCO_OS_ANDROID
|
||||
|
||||
void setInterfaceParams(struct ifaddrs* iface, NetworkInterfaceImpl& impl)
|
||||
{
|
||||
@ -1609,7 +1609,7 @@ void setInterfaceParams(struct ifaddrs* iface, NetworkInterfaceImpl& impl)
|
||||
|
||||
NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
||||
{
|
||||
#ifndef POCO_ANDROID
|
||||
#if POCO_OS != POCO_OS_ANDROID
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
Map result;
|
||||
unsigned ifIndex = 0;
|
||||
|
@ -175,7 +175,7 @@ private:
|
||||
void handlePidFile(const std::string& name, const std::string& value);
|
||||
bool isDaemon(int argc, char** argv);
|
||||
void beDaemon();
|
||||
#if defined(POCO_ANDROID)
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
static Poco::Event _terminate;
|
||||
#endif
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
|
@ -63,7 +63,7 @@ SERVICE_STATUS ServerApplication::_serviceStatus;
|
||||
SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(POCO_VXWORKS) || defined(POCO_ANDROID)
|
||||
#if defined(POCO_VXWORKS) || POCO_OS == POCO_OS_ANDROID
|
||||
Poco::Event ServerApplication::_terminate;
|
||||
#endif
|
||||
|
||||
@ -101,7 +101,7 @@ void ServerApplication::terminate()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
_terminate.set();
|
||||
#elif defined(POCO_VXWORKS) || defined(POCO_ANDROID)
|
||||
#elif defined(POCO_VXWORKS) || POCO_OS == POCO_OS_ANDROID
|
||||
_terminate.set();
|
||||
#else
|
||||
Poco::Process::requestTermination(Process::id());
|
||||
@ -569,7 +569,7 @@ void ServerApplication::defineOptions(OptionSet& options)
|
||||
//
|
||||
void ServerApplication::waitForTerminationRequest()
|
||||
{
|
||||
#ifndef POCO_ANDROID
|
||||
#if POCO_OS != POCO_OS_ANDROID
|
||||
sigset_t sset;
|
||||
sigemptyset(&sset);
|
||||
if (!std::getenv("POCO_ENABLE_DEBUGGER"))
|
||||
@ -581,7 +581,7 @@ void ServerApplication::waitForTerminationRequest()
|
||||
sigprocmask(SIG_BLOCK, &sset, NULL);
|
||||
int sig;
|
||||
sigwait(&sset, &sig);
|
||||
#else // POCO_ANDROID
|
||||
#else // POCO_OS != POCO_OS_ANDROID
|
||||
_terminate.wait();
|
||||
#endif
|
||||
}
|
||||
|
@ -123,5 +123,5 @@ endif(IOS)
|
||||
|
||||
#Android
|
||||
if (ANDROID)
|
||||
add_definitions( -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY )
|
||||
add_definitions( -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY )
|
||||
endif(ANDROID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user