File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 99#include < plg/string.hpp>
1010#include < plg/numerics.hpp>
1111
12- #include < stacktrace>
1312#include < plugify/assembly_loader.hpp>
1413
14+ #if __has_include(<stacktrace>)
15+ #include < stacktrace>
16+ #define HAS_STACKTRACE 1
17+ #else
18+ #define HAS_STACKTRACE 0
19+ #endif
20+
1521#define LOG_PREFIX " [GOLM] "
1622
1723using namespace golm ;
@@ -265,9 +271,10 @@ const char* GetCacheDir() {
265271void PrintException (GoString message) {
266272 if (const auto & provider = g_golm.GetProvider ()) {
267273 provider->Log (std::format (LOG_PREFIX " [Exception] {}" , std::string_view (message)), Severity::Error);
268-
274+ # if HAS_STACKTRACE
269275 auto trace = std::stacktrace::current ();
270276 provider->Log (std::to_string (trace), Severity::Error);
277+ #endif
271278 }
272279}
273280
You can’t perform that action at this time.
0 commit comments