From 8ff4c8754c52caffbb059ba6bbf4a727c949a7b6 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 7 Jul 2017 08:03:41 +0200 Subject: main: remove CHECK_WAYLAND, inline logic into WRAP Signed-off-by: Marcus Fritzsch --- src/main.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index ed71152..4adf2f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -199,15 +199,6 @@ int binding_init() noexcept { return -1; } -#define CHECK_WAYLAND() \ - do { \ - if (g_wayland == nullptr) { \ - afb_req_fail(req, "failed", \ - "Binding not initialized, did the compositor die?"); \ - return; \ - } \ - } while (0) - // _ _ _ _ ____ // __| | ___| |__ _ _ __ _ ___| |_ __ _| |_ _ _ ___ / /\ \ // / _` |/ _ \ '_ \| | | |/ _` | / __| __/ _` | __| | | / __| | | | @@ -238,7 +229,11 @@ void debug_layers(afb_req req) { #define WRAP(F) \ [](afb_req req) noexcept { \ - CHECK_WAYLAND(); \ + if (g_wayland == nullptr) { \ + afb_req_fail(req, "failed", \ + "Binding not initialized, did the compositor die?"); \ + return; \ + } \ try { \ F(req); \ } catch (std::exception & e) { \ -- cgit 1.2.3-korg