add crash log directory

This commit is contained in:
altalk23 2022-10-08 17:27:28 +03:00
parent da998694a0
commit 40bf7962ea
3 changed files with 24 additions and 19 deletions

View file

@ -79,8 +79,8 @@ public:
class CCDestructor : public CCCopying {
private:
static inline auto& destructorLock() {
static std::unordered_map<void*, bool> ret;
return ret;
static auto ret = new std::unordered_map<void*, bool>;
return *ret;
}
public:
static inline bool& globalLock() {

View file

@ -1,17 +0,0 @@
#include "../crashlog.hpp"
#ifdef GEODE_IS_MACOS
bool crashlog::setupPlatformHandler() {
return false;
}
bool crashlog::didLastLaunchCrash() {
return false;
}
std::string crashlog::getCrashLogDirectory() {
return "";
}
#endif

View file

@ -0,0 +1,22 @@
#include "../crashlog.hpp"
#include <CoreFoundation/CoreFoundation.h>
#include <signal.h>
#ifdef GEODE_IS_MACOS
bool crashlog::setupPlatformHandler() {
return true;
}
bool crashlog::didLastLaunchCrash() {
return false;
}
std::string crashlog::getCrashLogDirectory() {
std::array<char, 1024> path;
CFStringGetCString((CFStringRef)NSHomeDirectory(), path.data(), path.size(), kCFStringEncodingUTF8);
auto crashlogDir = ghc::filesystem::path(path.data()) / "Library" / "Logs" / "DiagnosticReports";
return crashlogDir.string();
}
#endif