From 8ff4c8754c52caffbb059ba6bbf4a727c949a7b6 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 7 Jul 2017 08:03:41 +0200 Subject: [PATCH] main: remove CHECK_WAYLAND, inline logic into WRAP Signed-off-by: Marcus Fritzsch --- src/main.cpp | 15 +++++---------- src/util.hpp | 1 + 2 files changed, 6 insertions(+), 10 deletions(-) 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) { \ diff --git a/src/util.hpp b/src/util.hpp index 253f656..84c2462 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -3,6 +3,7 @@ #include #include + #include extern "C" { -- 2.16.6