5#if defined(_WIN32) || defined(_WIN64)
7# define GET_EXECUTABLE_PATH() getExecutablePathWindows()
8static std::string getExecutablePathWindows() {
10 GetModuleFileName(NULL, path, MAX_PATH);
11 return std::string(path);
13#elif defined(__linux__)
16# define GET_EXECUTABLE_PATH() getExecutablePathLinux()
17static std::string getExecutablePathLinux() {
19 ssize_t len = ::readlink(
"/proc/self/exe", path,
sizeof(path) - 1);
22 return std::string(path);
26#elif defined(__APPLE__) || defined(__MACH__)
27# include <objc/objc.h>
28# include <objc/runtime.h>
29# define GET_EXECUTABLE_PATH() getExecutablePathMacOS()
30static std::string getExecutablePathMacOS() {
32 NSString *path = [[NSBundle mainBundle] executablePath];
33 return std::string([path UTF8String]);
37# error "Unsupported platform"
41 std::filesystem::current_path().string();
const std::string EXECUTABLE_DIR
Get the directory of the executable.
const std::string CURRENT_WORKING_DIRECTORY
Get the current working directory.
const std::string EXECUTABLE_PATH
Get the path of the executable.
This file contains the declaration of paths used in xcal.