| 1049 | } |
| 1050 | |
| 1051 | static const char* get_current_executable_path() { |
| 1052 | static const char* path = []() -> const char* { |
| 1053 | static char buffer[JITIFY_PATH_MAX] = {}; |
| 1054 | #ifdef __linux__ |
| 1055 | if (!::realpath("/proc/self/exe", buffer)) return nullptr; |
| 1056 | #elif defined(_WIN32) || defined(_WIN64) |
| 1057 | if (!GetModuleFileNameA(nullptr, buffer, JITIFY_PATH_MAX)) return nullptr; |
| 1058 | #endif |
| 1059 | return buffer; |
| 1060 | }(); |
| 1061 | return path; |
| 1062 | } |
| 1063 | |
| 1064 | inline bool endswith(const std::string& str, const std::string& suffix) { |
| 1065 | return str.size() >= suffix.size() && |