diff options
author | Max Kellermann <max@musicpd.org> | 2019-12-16 23:43:51 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-12-16 23:44:20 +0100 |
commit | 683d5848f414d1539686df2e0dc886d5252d34fe (patch) | |
tree | f082db3606a8afcd4413c88fc32e5394356c51ee /src/system | |
parent | b4496272650f654113be00efddfda1deea8bb5a7 (diff) | |
parent | 5680a3a4b71661179b81e6434928d919d186c785 (diff) |
Merge tag 'v0.21.17'
release v0.21.17
Diffstat (limited to 'src/system')
-rw-r--r-- | src/system/Error.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/system/Error.hxx b/src/system/Error.hxx index a22c3ba29..5027e6864 100644 --- a/src/system/Error.hxx +++ b/src/system/Error.hxx @@ -147,6 +147,18 @@ FormatErrno(const char *fmt, Args&&... args) noexcept return FormatErrno(errno, fmt, std::forward<Args>(args)...); } +template<typename... Args> +static inline std::system_error +FormatFileNotFound(const char *fmt, Args&&... args) noexcept +{ +#ifdef _WIN32 + return FormatLastError(ERROR_FILE_NOT_FOUND, fmt, + std::forward<Args>(args)...); +#else + return FormatErrno(ENOENT, fmt, std::forward<Args>(args)...); +#endif +} + gcc_pure inline bool IsErrno(const std::system_error &e, int code) noexcept |