diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-07-07 08:03:41 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | 8ff4c8754c52caffbb059ba6bbf4a727c949a7b6 (patch) | |
tree | abf841d91602dfaa47878a35bdd4806eaed8a049 | |
parent | 08d25dcc9db8ff5f3ef4456f056d3e89f70e4f1f (diff) |
main: remove CHECK_WAYLAND, inline logic into WRAP
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r-- | src/main.cpp | 15 | ||||
-rw-r--r-- | 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 <functional> #include <sys/poll.h> + #include <vector> extern "C" { |