From b2030be95f0aadfb1438f1747b8ca5c0945705a7 Mon Sep 17 00:00:00 2001 From: Justin Scofield <47263509+scawful@users.noreply.github.com> Date: Sat, 27 Aug 2022 22:06:41 -0500 Subject: [PATCH] add PRINT_IF_ERROR macro --- src/app/core/constants.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/core/constants.h b/src/app/core/constants.h index 27fd6507..888aa682 100644 --- a/src/app/core/constants.h +++ b/src/app/core/constants.h @@ -25,6 +25,14 @@ #define MENU_ITEM(w) if (ImGui::MenuItem(w)) #define MENU_ITEM2(w, v) if (ImGui::MenuItem(w, v)) +#define PRINT_IF_ERROR(expression) \ + { \ + auto error = expression; \ + if (!error.ok()) { \ + std::cout << error.ToString() << std::endl; \ + } \ + } + #define RETURN_IF_ERROR(expression) \ { \ auto error = expression; \