Made the lib work with -fno-exceptions (at least for now).

This commit is contained in:
2025-03-02 14:35:37 +01:00
parent 21b3b2c03a
commit ba23cb0c70
5 changed files with 50 additions and 12 deletions

View File

@@ -457,6 +457,7 @@ inline const char* errorName(StreamError error) MIJIN_NOEXCEPT
return "<invalid error>";
}
#if MIJIN_ENABLE_EXCEPTIONS // these functions don't make sense with exceptions disabled
inline void throwOnError(mijin::StreamError error)
{
if (error == mijin::StreamError::SUCCESS) {
@@ -500,6 +501,7 @@ inline decltype(auto) throwOnError(StreamResult<TSuccess>&& result, const std::s
}
return *result;
}
#endif // MIJIN_ENABLE_EXCEPTIONS
} // namespace mijin
#endif // !defined(MIJIN_IO_STREAM_HPP_INCLUDED)