mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-17 09:23:10 +08:00
[refactor] reorganize platform and wire sources
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include "platform/daemon_backend.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <mach-o/dyld.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace crossdesk::platform {
|
||||
|
||||
bool PrepareDaemon() { return true; }
|
||||
|
||||
std::string GetDaemonExecutablePath() {
|
||||
char path[PATH_MAX] = {};
|
||||
uint32_t size = sizeof(path);
|
||||
if (_NSGetExecutablePath(path, &size) != 0) return {};
|
||||
char resolved[PATH_MAX] = {};
|
||||
return realpath(path, resolved) ? std::string(resolved) : std::string(path);
|
||||
}
|
||||
|
||||
} // namespace crossdesk::platform
|
||||
Reference in New Issue
Block a user