diff options
Diffstat (limited to 'zencore/except.cpp')
| -rw-r--r-- | zencore/except.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/zencore/except.cpp b/zencore/except.cpp index fae629286..2749d1984 100644 --- a/zencore/except.cpp +++ b/zencore/except.cpp @@ -58,12 +58,6 @@ ThrowSystemException([[maybe_unused]] HRESULT hRes, [[maybe_unused]] std::string #endif // ZEN_PLATFORM_WINDOWS void -ThrowLastError(std::string_view Message) -{ - throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()), std::string(Message)); -} - -void ThrowSystemError(uint32_t ErrorCode, std::string_view Message) { throw std::system_error(std::error_code(ErrorCode, std::system_category()), std::string(Message)); @@ -83,11 +77,16 @@ GetSystemErrorAsString(uint32_t ErrorCode) #if defined(__cpp_lib_source_location) void -ThrowLastError(std::string_view Message, const std::source_location& Location) +ThrowLastErrorImpl(std::string_view Message, const std::source_location& Location) { - using namespace fmt::literals; throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()), - "{}({}): {}"_format(Location.file_name(), Location.line(), Message)); + fmt::format("{}({}): {}", Location.file_name(), Location.line(), Message)); +} +#else +void +ThrowLastError(std::string_view Message) +{ + throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()), std::string(Message)); } #endif |