aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zencore/include/zencore/except.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/zencore/include/zencore/except.h b/zencore/include/zencore/except.h
index eff03d8ce..aa4c1462d 100644
--- a/zencore/include/zencore/except.h
+++ b/zencore/include/zencore/except.h
@@ -51,17 +51,21 @@ private:
ZENCORE_API void ThrowSystemException(HRESULT hRes, std::string_view Message);
+ZENCORE_API void ThrowLastError(std::string_view Message);
+ZENCORE_API void ThrowLastError(std::string_view Message, const std::source_location& Location);
+ZENCORE_API std::string GetLastErrorAsString();
+ZENCORE_API std::string GetWindowsErrorAsString(uint32_t Win32ErrorCode);
+
inline void
ThrowSystemException(const char* Message)
{
+#if ZEN_PLATFORM_WINDOWS
throw WindowsException(Message);
+#else
+ ThrowLastError(Message);
+#endif
}
-ZENCORE_API void ThrowLastError(std::string_view Message);
-ZENCORE_API void ThrowLastError(std::string_view Message, const std::source_location& Location);
-ZENCORE_API std::string GetLastErrorAsString();
-ZENCORE_API std::string GetWindowsErrorAsString(uint32_t Win32ErrorCode);
-
inline int32_t
GetLastError()
{