[ox/std] Make oxThrowError do a move to satisfy clang-tidy
This commit is contained in:
parent
196c7844ea
commit
ae62f89fe8
3
deps/ox/src/ox/std/error.hpp
vendored
3
deps/ox/src/ox/std/error.hpp
vendored
@ -19,6 +19,7 @@ namespace ox {
|
|||||||
|
|
||||||
using ErrorCode = uint16_t;
|
using ErrorCode = uint16_t;
|
||||||
|
|
||||||
|
|
||||||
struct [[nodiscard]] Error {
|
struct [[nodiscard]] Error {
|
||||||
const char *msg = nullptr;
|
const char *msg = nullptr;
|
||||||
const char *file = nullptr;
|
const char *file = nullptr;
|
||||||
@ -127,7 +128,7 @@ constexpr void oxIgnoreError(ox::Error) noexcept {}
|
|||||||
#define oxThrowError(x) if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] throw _ox_error
|
#define oxThrowError(x) if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] throw _ox_error
|
||||||
#else
|
#else
|
||||||
#define oxReturnError(err) if (const auto _ox_error = ox::detail::toError(err)) return _ox_error
|
#define oxReturnError(err) if (const auto _ox_error = ox::detail::toError(err)) return _ox_error
|
||||||
#define oxThrowError(err) if (const auto _ox_error = ox::detail::toError(err)) throw _ox_error
|
#define oxThrowError(err) if (const auto _ox_error = ox::detail::toError(err)) throw ox::move(_ox_error)
|
||||||
#endif
|
#endif
|
||||||
#define oxConcatImpl(a, b) a##b
|
#define oxConcatImpl(a, b) a##b
|
||||||
#define oxConcat(a, b) oxConcatImpl(a, b)
|
#define oxConcat(a, b) oxConcatImpl(a, b)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user