| 395 | } |
| 396 | |
| 397 | string errorString(int errorId) { |
| 398 | #ifdef _WIN32 |
| 399 | char* s = NULL; |
| 400 | FormatMessage( |
| 401 | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 402 | NULL, |
| 403 | errorId, |
| 404 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), |
| 405 | (LPSTR)&s, |
| 406 | 0, |
| 407 | NULL |
| 408 | ); |
| 409 | |
| 410 | string result = fmt::format("{} ({})", s, errorId); |
| 411 | LocalFree(s); |
| 412 | |
| 413 | return result; |
| 414 | #else |
| 415 | return fmt::format("{} ({})", strerror(errorId), errno); |
| 416 | #endif |
| 417 | } |
| 418 | |
| 419 | fs::path homeDirectory() { |
| 420 | #ifdef _WIN32 |
no outgoing calls
no test coverage detected