mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-15 03:25:01 -05:00
add crash log directory
This commit is contained in:
parent
da998694a0
commit
40bf7962ea
3 changed files with 24 additions and 19 deletions
|
@ -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() {
|
||||
|
|
|
@ -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
|
22
loader/src/internal/mac/crashlog.mm
Normal file
22
loader/src/internal/mac/crashlog.mm
Normal 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
|
Loading…
Reference in a new issue