summarylogtreecommitdiffstats
path: root/0002-fix-main-Handle-different-LLVM-version.patch
blob: f9b42fbc85e4894dc88db71f63cf76ff3dd77c5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 460ae24e289f8c10696b88a468a94100b2a39965 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Sun, 31 Dec 2023 13:29:36 +0100
Subject: [PATCH 2/2] fix(main): Handle different LLVM version

---
 main/gui/source/crash_handlers.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/main/gui/source/crash_handlers.cpp b/main/gui/source/crash_handlers.cpp
index 2ddf766c..2ff85621 100644
--- a/main/gui/source/crash_handlers.cpp
+++ b/main/gui/source/crash_handlers.cpp
@@ -14,6 +14,8 @@
 #include <nlohmann/json.hpp>
 
 #include <stacktrace.hpp>
+
+#include <llvm/Config/llvm-config.h>
 #include <llvm/Demangle/Demangle.h>
 
 #include <csignal>
@@ -142,7 +144,11 @@ namespace hex::crash {
         try {
             std::rethrow_exception(std::current_exception());
         } catch (std::exception &ex) {
+#if LLVM_VERSION_MAJOR >= 17
             std::string exceptionStr = hex::format("{}()::what() -> {}", llvm::itaniumDemangle(typeid(ex).name()), ex.what());
+#else
+            std::string exceptionStr = hex::format("{}()::what() -> {}", llvm::itaniumDemangle(typeid(ex).name(), nullptr, nullptr, nullptr), ex.what());
+#endif
 
             handleCrash(exceptionStr);
             log::fatal("Program terminated with uncaught exception: {}", exceptionStr);
-- 
2.43.0