aboutsummaryrefslogtreecommitdiff
path: root/zencore/except.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-15 14:56:47 +0200
committerStefan Boberg <[email protected]>2021-09-15 14:56:47 +0200
commit7fa42126867b0c2e87eac035179250bf51a3f5c4 (patch)
tree73d5d20796aaafb66a691d0d0bc5db97aa267cca /zencore/except.cpp
parentUnsigned / signed comparison warning fixes (diff)
downloadzen-7fa42126867b0c2e87eac035179250bf51a3f5c4.tar.xz
zen-7fa42126867b0c2e87eac035179250bf51a3f5c4.zip
Handle absence of std::source_location somewhat more gracefully (relies on client code also checking)
Diffstat (limited to 'zencore/except.cpp')
-rw-r--r--zencore/except.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/zencore/except.cpp b/zencore/except.cpp
index d57b539cd..834585522 100644
--- a/zencore/except.cpp
+++ b/zencore/except.cpp
@@ -40,6 +40,7 @@ GetWindowsErrorAsString(uint32_t Win32ErrorCode)
return std::error_code(Win32ErrorCode, std::system_category()).message();
}
+#if __cpp_lib_source_location
void
ThrowLastError(std::string_view Message, const std::source_location& Location)
{
@@ -47,5 +48,6 @@ ThrowLastError(std::string_view Message, const std::source_location& Location)
throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()),
"{}({}): {}"_format(Location.file_name(), Location.line(), Message));
}
+#endif
} // namespace zen