From 16c56e1d504255f1a823264fc795d8fe6d7815cb Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 30 May 2023 20:51:54 -0500 Subject: [PATCH] [ox] Put oxReturnError and oxThrowError in brackets (synced from d598efb5eacbb3ed820df56cde3464fb4447840e) --- src/ox/std/def.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ox/std/def.hpp b/src/ox/std/def.hpp index 60cb34c55..5417dfe0c 100644 --- a/src/ox/std/def.hpp +++ b/src/ox/std/def.hpp @@ -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 * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -49,13 +49,8 @@ // Error handling -#if __cplusplus >= 202002L -#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) -#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 oxReturnError(x) { if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] return _ox_error; } (void) 0 +#define oxThrowError(x) { if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] throw ox::Exception(_ox_error); } (void) 0 #define oxConcatImpl(a, b) a##b #define oxConcat(a, b) oxConcatImpl(a, b) // oxRequire Mutable