[ox] Put oxReturnError and oxThrowError in brackets

This commit is contained in:
Gary Talent 2023-05-30 20:51:54 -05:00
parent fa4e3c6329
commit d598efb5ea

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2015 - 2022 gary@drinkingtea.net * Copyright 2015 - 2023 gary@drinkingtea.net
* *
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
@ -49,13 +49,8 @@
// Error handling // Error handling
#if __cplusplus >= 202002L #define oxReturnError(x) { if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] return _ox_error; } (void) 0
#define oxReturnError(x) if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] return _ox_error #define oxThrowError(x) { if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] throw ox::Exception(_ox_error); } (void) 0
#define oxThrowError(x) if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] throw ox::Exception(_ox_error)
#else
#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::Exception(_ox_error)
#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)
// oxRequire Mutable // oxRequire Mutable