diff --git a/uppsrc/Core/Core.upp b/uppsrc/Core/Core.upp index 08a8353af..cc859d21f 100644 --- a/uppsrc/Core/Core.upp +++ b/uppsrc/Core/Core.upp @@ -9,7 +9,7 @@ library(MSC !MSC8ARM) "kernel32 user32 ws2_32"; library(WIN32 !GUI !GNU !GCC) "ole32 oleaut32 oldnames"; -library(LINUX) "pthread dl rt"; +library(LINUX !ANDROID) "pthread dl rt"; library(BSD) "pthread rt execinfo"; diff --git a/uppsrc/Core/Cpu.cpp b/uppsrc/Core/Cpu.cpp index cd512d3fd..956d847fd 100644 --- a/uppsrc/Core/Cpu.cpp +++ b/uppsrc/Core/Cpu.cpp @@ -106,7 +106,11 @@ int CPU_Cores() int CPU_Cores() { - return minmax(get_nprocs(), 1, 256); + #ifdef PLATFORM_ANDROID + return 1; + #else + return minmax(get_nprocs(), 1, 256); + #endif } #else int CPU_Cores() diff --git a/uppsrc/Core/Lang.cpp b/uppsrc/Core/Lang.cpp index 2f9d7ed11..6824782d8 100644 --- a/uppsrc/Core/Lang.cpp +++ b/uppsrc/Core/Lang.cpp @@ -6,7 +6,9 @@ #endif #ifdef PLATFORM_POSIX #include -#include + #ifndef PLATFORM_ANDROID + #include + #endif #endif NAMESPACE_UPP diff --git a/uppsrc/Core/LangInfo.cpp b/uppsrc/Core/LangInfo.cpp index d0873a947..9c4377308 100644 --- a/uppsrc/Core/LangInfo.cpp +++ b/uppsrc/Core/LangInfo.cpp @@ -6,7 +6,9 @@ #endif #ifdef PLATFORM_POSIX #include -#include + #ifndef PLATFORM_ANDROID + #include + #endif #endif namespace Upp { @@ -295,7 +297,7 @@ void LanguageInfo::Set(int lang_) } #endif -#ifdef PLATFORM_POSIX +#if defined(PLATFORM_POSIX) && !defined(PLATFORM_ANDROID) String langtext = LNGAsText(language); char ltext[6]; ltext[0] = ToLower(langtext[0]); diff --git a/uppsrc/Core/Rpc/imp/Server.cpp b/uppsrc/Core/Rpc/imp/Server.cpp index df778d0e3..de4221532 100644 --- a/uppsrc/Core/Rpc/imp/Server.cpp +++ b/uppsrc/Core/Rpc/imp/Server.cpp @@ -119,7 +119,6 @@ struct XmlRpcDo { XmlRpcDo::XmlRpcDo(TcpSocket& http, const char *group) : http(http), group(group) { - data.rpc = this; } String XmlRpcDo::XmlResult() diff --git a/uppsrc/Core/Util.cpp b/uppsrc/Core/Util.cpp index 707cd0b4f..08baf26c8 100644 --- a/uppsrc/Core/Util.cpp +++ b/uppsrc/Core/Util.cpp @@ -4,7 +4,7 @@ # include #endif -#if defined(PLATFORM_POSIX) && defined(COMPILER_GCC) +#if defined(PLATFORM_POSIX) && defined(COMPILER_GCC) && !defined(PLATFORM_ANDROID) # include # include #endif @@ -38,7 +38,7 @@ void PanicMessageBox(const char *title, const char *text) } -#if defined(PLATFORM_POSIX) && defined(COMPILER_GCC) +#if defined(PLATFORM_POSIX) && defined(COMPILER_GCC) && !defined(PLATFORM_ANDROID) void AddStackTrace(char * str, int len) { const size_t max_depth = 100; diff --git a/uppsrc/Core/config.h b/uppsrc/Core/config.h index 22ac40c79..e9b113a05 100644 --- a/uppsrc/Core/config.h +++ b/uppsrc/Core/config.h @@ -18,9 +18,12 @@ #if __unix || __unix__ || __APPLE__ #define PLATFORM_POSIX 1 - + #if __linux #define PLATFORM_LINUX 1 + #if __ANDROID__ + #define PLATFORM_ANDROID 1 + #endif // zvzv add // __linux is undef on APPLE MACOSX, MACOSX has BSD stuff #elif __APPLE__ @@ -76,6 +79,12 @@ #define CPU_BE 1 #define CPU_BIG_ENDIAN 1 #define CPU_ALIGNED 1 + #elif __aarch64__ + #define CPU_64 1 + #define CPU_ARM 1 + #define CPU_LE 1 + #define CPU_LITTLE_ENDIAN 1 + #define CPU_UNALIGNED 1 #elif __arm__ #define CPU_32 1 #define CPU_ARM 1