8 #elif defined(__linux__) 13 #include <mach-o/dyld.h> 16 #define ASSETS_PATH "../Assets/" 17 #define CONFIG_PATH "../Config/" 19 inline std::string FullPath() {
23 #elif defined(__linux__) 25 ssize_t len = readlink(
"/proc/self/exe", buf,
sizeof(buf) - 1);
28 path = std::string(buf);
34 uint32_t bufsize = PATH_MAX;
35 if (!_NSGetExecutablePath(buf, &bufsize)) {
36 path = std::string(buf);
42 size_t lastSlash = path.find_last_of(
'/');
43 if (lastSlash == std::string::npos) {
46 return path.substr(0, lastSlash + 1);
50 inline std::string FullAssetsPath() {
return FullPath() + ASSETS_PATH; }
53 inline std::string FullConfigPath() {
return FullPath() + CONFIG_PATH; }