From 1e079353663d34d4eb8ab4f9640a67f7e5ba95d6 Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 11 Feb 2024 03:12:52 +0100 Subject: [PATCH] Make crashCatcherInstall no-op for Android The crashcatcher.cpp is not linked on Android because it's not supported but the function need to have some definition. Make it empty to avoid link failures. --- components/crashcatcher/crashcatcher.cpp | 3 --- components/crashcatcher/crashcatcher.hpp | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/crashcatcher/crashcatcher.cpp b/components/crashcatcher/crashcatcher.cpp index 9a662c4a92..009029ef19 100644 --- a/components/crashcatcher/crashcatcher.cpp +++ b/components/crashcatcher/crashcatcher.cpp @@ -583,8 +583,6 @@ static bool isDebuggerPresent() void crashCatcherInstall(int argc, char** argv, const std::filesystem::path& crashLogPath) { -#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) \ - || defined(__posix)) if (argc == 2 && strcmp(argv[1], crash_switch) == 0) handleCrash(Files::pathToUnicodeString(crashLogPath).c_str()); @@ -595,5 +593,4 @@ void crashCatcherInstall(int argc, char** argv, const std::filesystem::path& cra Log(Debug::Info) << "Crash handler installed"; else Log(Debug::Warning) << "Installing crash handler failed"; -#endif } diff --git a/components/crashcatcher/crashcatcher.hpp b/components/crashcatcher/crashcatcher.hpp index 9dd1000385..16b416cf98 100644 --- a/components/crashcatcher/crashcatcher.hpp +++ b/components/crashcatcher/crashcatcher.hpp @@ -3,6 +3,11 @@ #include +#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) \ + || defined(__posix)) void crashCatcherInstall(int argc, char** argv, const std::filesystem::path& crashLogPath); +#else +inline void crashCatcherInstall(int /*argc*/, char** /*argv*/, const std::filesystem::path& /*crashLogPath*/) {} +#endif #endif