|
| 1 | +From 62c87df518bb297c44a9fc66ad26a81a7b85057c Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ronald Y < [email protected]> |
| 3 | +Date: Sun, 22 Sep 2024 09:27:21 +0800 |
| 4 | +Subject: [PATCH 5/8] apply some android-specific patch |
| 5 | + |
| 6 | +Change-Id: I4be7216701e300369a2ccde7b57fe0966d0645b5 |
| 7 | +--- |
| 8 | + .../cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx | 2 +- |
| 9 | + bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx | 2 +- |
| 10 | + bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx | 4 ++-- |
| 11 | + bridges/source/cpp_uno/gcc3_linux_arm/except.cxx | 10 +++++----- |
| 12 | + bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx | 8 ++++---- |
| 13 | + desktop/source/app/app.cxx | 6 +++--- |
| 14 | + 6 files changed, 16 insertions(+), 16 deletions(-) |
| 15 | + |
| 16 | +diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx |
| 17 | +index b944f31cf..84cf10fa4 100644 |
| 18 | +--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx |
| 19 | ++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx |
| 20 | +@@ -55,7 +55,7 @@ void callVirtualFunction( |
| 21 | + "m" (stackargs) // dummy input to prevent optimizing the alloca away |
| 22 | + : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", |
| 23 | + "r11", "r12", "r13", "r14", "r15", "r16", "r17", |
| 24 | +-#if !defined ANDROID && !defined MACOSX |
| 25 | ++#if !defined __ANDROID__ && !defined MACOSX |
| 26 | + "r18"/*TODO?*/, |
| 27 | + #endif |
| 28 | + "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", |
| 29 | +diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |
| 30 | +index 669c4443c..bb3c2fcbd 100644 |
| 31 | +--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |
| 32 | ++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |
| 33 | +@@ -583,7 +583,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( |
| 34 | + void bridges::cpp_uno::shared::VtableFactory::flushCode( |
| 35 | + unsigned char const * begin, unsigned char const * end) |
| 36 | + { |
| 37 | +-#if !defined ANDROID && !defined MACOSX |
| 38 | ++#if !defined __ANDROID__ && !defined MACOSX |
| 39 | + static void (*clear_cache)(unsigned char const *, unsigned char const *) |
| 40 | + = (void (*)(unsigned char const *, unsigned char const *)) dlsym( |
| 41 | + RTLD_DEFAULT, "__clear_cache"); |
| 42 | +diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |
| 43 | +index f476cf7df..37636b0d2 100644 |
| 44 | +--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |
| 45 | ++++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |
| 46 | +@@ -38,7 +38,7 @@ |
| 47 | + |
| 48 | + #include <dlfcn.h> |
| 49 | + |
| 50 | +-#ifdef ANDROID |
| 51 | ++#ifdef __ANDROID__ |
| 52 | + #include <unistd.h> |
| 53 | + #endif |
| 54 | + |
| 55 | +@@ -580,7 +580,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( |
| 56 | + void bridges::cpp_uno::shared::VtableFactory::flushCode( |
| 57 | + unsigned char const *beg, unsigned char const *end) |
| 58 | + { |
| 59 | +-#ifndef ANDROID |
| 60 | ++#ifndef __ANDROID__ |
| 61 | + static void (*clear_cache)(unsigned char const*, unsigned char const*) |
| 62 | + = reinterpret_cast<void (*)(unsigned char const*, unsigned char const*)> |
| 63 | + (dlsym(RTLD_DEFAULT, "__clear_cache")); |
| 64 | +diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx |
| 65 | +index 14bffa75a..8a6dfe6d5 100644 |
| 66 | +--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx |
| 67 | ++++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx |
| 68 | +@@ -94,7 +94,7 @@ namespace { |
| 69 | + t_rtti_map m_rttis; |
| 70 | + t_rtti_map m_generatedRttis; |
| 71 | + |
| 72 | +-#ifndef ANDROID |
| 73 | ++#ifndef __ANDROID__ |
| 74 | + void * m_hApp; |
| 75 | + #endif |
| 76 | + |
| 77 | +@@ -107,7 +107,7 @@ namespace { |
| 78 | + } |
| 79 | + |
| 80 | + RTTI::RTTI() |
| 81 | +-#ifndef ANDROID |
| 82 | ++#ifndef __ANDROID__ |
| 83 | + : m_hApp( dlopen( nullptr, RTLD_LAZY ) ) |
| 84 | + #endif |
| 85 | + { |
| 86 | +@@ -115,7 +115,7 @@ namespace { |
| 87 | + |
| 88 | + RTTI::~RTTI() |
| 89 | + { |
| 90 | +-#ifndef ANDROID |
| 91 | ++#ifndef __ANDROID__ |
| 92 | + dlclose( m_hApp ); |
| 93 | + #endif |
| 94 | + } |
| 95 | +@@ -146,7 +146,7 @@ namespace { |
| 96 | + buf.append( 'E' ); |
| 97 | + |
| 98 | + OString symName( buf.makeStringAndClear() ); |
| 99 | +-#ifndef ANDROID |
| 100 | ++#ifndef __ANDROID__ |
| 101 | + rtti = static_cast<type_info *>(dlsym( m_hApp, symName.getStr() )); |
| 102 | + #else |
| 103 | + rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() ); |
| 104 | +@@ -170,7 +170,7 @@ namespace { |
| 105 | + // symbol and rtti-name is nearly identical, |
| 106 | + // the symbol is prefixed with _ZTI |
| 107 | + |
| 108 | +-#ifdef ANDROID |
| 109 | ++#ifdef __ANDROID__ |
| 110 | + // This code is supposed to be used only used for |
| 111 | + // inter-process UNO, says sberg. Thus it should |
| 112 | + // be unnecessary and never reached for |
| 113 | +diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |
| 114 | +index 9bce77bc8..a5bfc5b0e 100644 |
| 115 | +--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |
| 116 | ++++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |
| 117 | +@@ -78,7 +78,7 @@ class RTTI |
| 118 | + std::vector<OString> m_rttiNames; |
| 119 | + std::unordered_map<OUString, std::unique_ptr<Generated>> m_generatedRttis; |
| 120 | + |
| 121 | +-#if !defined ANDROID |
| 122 | ++#if !defined __ANDROID__ |
| 123 | + void * m_hApp; |
| 124 | + #endif |
| 125 | + |
| 126 | +@@ -90,7 +90,7 @@ public: |
| 127 | + }; |
| 128 | + |
| 129 | + RTTI::RTTI() |
| 130 | +-#if !defined ANDROID |
| 131 | ++#if !defined __ANDROID__ |
| 132 | + : m_hApp( dlopen( nullptr, RTLD_LAZY ) ) |
| 133 | + #endif |
| 134 | + { |
| 135 | +@@ -98,7 +98,7 @@ RTTI::RTTI() |
| 136 | + |
| 137 | + RTTI::~RTTI() |
| 138 | + { |
| 139 | +-#if !defined ANDROID |
| 140 | ++#if !defined __ANDROID__ |
| 141 | + dlclose( m_hApp ); |
| 142 | + #endif |
| 143 | + } |
| 144 | +@@ -128,7 +128,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) |
| 145 | + buf.append( 'E' ); |
| 146 | + |
| 147 | + OString symName( buf.makeStringAndClear() ); |
| 148 | +-#if !defined ANDROID |
| 149 | ++#if !defined __ANDROID__ |
| 150 | + rtti = static_cast<std::type_info *>(dlsym( m_hApp, symName.getStr() )); |
| 151 | + #else |
| 152 | + rtti = static_cast<std::type_info *>(dlsym( RTLD_DEFAULT, symName.getStr() )); |
| 153 | +diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx |
| 154 | +index 0d66a48da..82160e1a7 100644 |
| 155 | +--- a/desktop/source/app/app.cxx |
| 156 | ++++ b/desktop/source/app/app.cxx |
| 157 | +@@ -505,7 +505,7 @@ void Desktop::Init() |
| 158 | + RequestHandler::Status aStatus = RequestHandler::Enable(true); |
| 159 | + if ( aStatus == RequestHandler::IPC_STATUS_PIPE_ERROR ) |
| 160 | + { |
| 161 | +-#if defined(ANDROID) || defined(EMSCRIPTEN) |
| 162 | ++#if defined(__ANDROID__) || defined(EMSCRIPTEN) |
| 163 | + // Ignore crack pipe errors on Android |
| 164 | + #else |
| 165 | + // Keep using this oddly named BE_PATHINFO_MISSING value |
| 166 | +@@ -917,7 +917,7 @@ void handleCrashReport() |
| 167 | + } |
| 168 | + #endif |
| 169 | + |
| 170 | +-#if !defined ANDROID |
| 171 | ++#if !defined __ANDROID__ |
| 172 | + void handleSafeMode() |
| 173 | + { |
| 174 | + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); |
| 175 | +@@ -1973,7 +1973,7 @@ void Desktop::OpenClients() |
| 176 | + // need some time, where the user won't see any results and wait for finishing the office startup... |
| 177 | + bool bAllowRecoveryAndSessionManagement = ( !rArgs.IsNoRestore() ) && ( !rArgs.IsHeadless() ); |
| 178 | + |
| 179 | +-#if !defined ANDROID |
| 180 | ++#if !defined __ANDROID__ |
| 181 | + // Enter safe mode if requested |
| 182 | + if (Application::IsSafeModeEnabled()) { |
| 183 | + handleSafeMode(); |
| 184 | +-- |
| 185 | +2.46.1 |
| 186 | + |
0 commit comments