From 8cffd0761b7bf3570a715adc89fb1a4c76a8662f Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 28 Jun 2021 17:16:43 +0200 Subject: [PATCH] Move the THROW_X11_ERROR macro up --- src/wine-host/editor.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index 829bfab7..2f2ed9bd 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -20,6 +20,20 @@ using namespace std::literals::chrono_literals; +// A catchable alternative to `assert()`. Normally all of our `assert(!error)` +// should never fail, except for when Ardour hides the editor window without +// closing the editor. In those case some of our X11 function calls may r turn +// errors. When this happens we want to be able to catch them in +// `handle_x11_events()`. +#define THROW_X11_ERROR(error) \ + do { \ + if (error) { \ + free(error); \ + throw std::runtime_error("X111 error in " + \ + std::string(__PRETTY_FUNCTION__)); \ + } \ + } while (0) + /** * The Win32 timer ID we'll use to periodically call the VST2 `effeditidle` * function with. We have to do this on a timer because the function has to be @@ -63,20 +77,6 @@ constexpr uint32_t xembed_focus_in_msg = 4; constexpr uint32_t xembed_focus_first = 1; -// A catchable alternative to `assert()`. Normally all of our `assert(!error)` -// should never fail, except for when Ardour hides the editor window without -// closing the editor. In those case some of our X11 function calls may r turn -// errors. When this happens we want to be able to catch them in -// `handle_x11_events()`. -#define THROW_X11_ERROR(error) \ - do { \ - if (error) { \ - free(error); \ - throw std::runtime_error("X111 error in " + \ - std::string(__PRETTY_FUNCTION__)); \ - } \ - } while (0) - /** * Find the the ancestors for the given window. This returns a list of window * IDs that starts wit h`starting_at`, and then iteratively contains the parent