aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-05-23 10:47:28 +0200
committerGitHub <[email protected]>2023-05-23 10:47:28 +0200
commit45aad3d98ee23e7f0e5873962a55c15a53d6b5c7 (patch)
tree8fbf9907a934c69aeea3e2fdf16802ae4b8c9ad0 /src/zencore/include
parentstreaming decompression support (#142) (diff)
downloadzen-45aad3d98ee23e7f0e5873962a55c15a53d6b5c7.tar.xz
zen-45aad3d98ee23e7f0e5873962a55c15a53d6b5c7.zip
use exception when allocations fail rather than asserts (#319)
* use exception when allocations fail rather than asserts * changelog
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/except.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/zencore/include/zencore/except.h b/src/zencore/include/zencore/except.h
index 114f98d77..464852f88 100644
--- a/src/zencore/include/zencore/except.h
+++ b/src/zencore/include/zencore/except.h
@@ -23,9 +23,12 @@ ZENCORE_API void ThrowSystemException [[noreturn]] (HRESULT hRes, std::string_vi
#if defined(__cpp_lib_source_location)
ZENCORE_API void ThrowLastErrorImpl [[noreturn]] (std::string_view Message, const std::source_location& Location);
-# define ThrowLastError(Message) ThrowLastErrorImpl(Message, std::source_location::current())
+ZENCORE_API void ThrowOutOfMemoryImpl [[noreturn]] (std::string_view Message, const std::source_location& Location);
+# define ThrowLastError(Message) ThrowLastErrorImpl(Message, std::source_location::current())
+# define ThrowOutOfMemory(Message) ThrowOutOfMemoryImpl(Message, std::source_location::current())
#else
ZENCORE_API void ThrowLastError [[noreturn]] (std::string_view Message);
+ZENCORE_API void ThrowOutOfMemory [[noreturn]] (std::string_view Message);
#endif
ZENCORE_API void ThrowSystemError [[noreturn]] (uint32_t ErrorCode, std::string_view Message);