From 99bebeca10f0d4c9bf61eb52be84849978e6e484 Mon Sep 17 00:00:00 2001 From: scawful Date: Mon, 31 Jul 2023 21:24:14 -0400 Subject: [PATCH] Add CLEAR_AND_RETURN_STATUS macro for ImGui stack --- src/app/core/constants.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/core/constants.h b/src/app/core/constants.h index 71baa648..206a5f80 100644 --- a/src/app/core/constants.h +++ b/src/app/core/constants.h @@ -82,6 +82,13 @@ ImGui::Text(text); \ ImGui::Separator(); +#define CLEAR_AND_RETURN_STATUS(status) \ + if (!status.ok()) { \ + auto temp = status; \ + status = absl::OkStatus(); \ + return temp; \ + } + using ushort = unsigned short; using uint = unsigned int; using uchar = unsigned char;