From f51c2f08a559f04f2c242f20cca7b19a1975e155 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Apr 2024 19:11:21 +0530 Subject: [PATCH] DRYer --- glfw/ibus_glfw.c | 1 + glfw/wl_client_side_decorations.c | 1 - glfw/wl_init.c | 2 -- glfw/wl_platform.h | 1 + glfw/wl_text_input.c | 1 + glfw/wl_window.c | 1 - glfw/xkb_glfw.c | 1 + 7 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glfw/ibus_glfw.c b/glfw/ibus_glfw.c index f4c77bdd6..43afb50ed 100644 --- a/glfw/ibus_glfw.c +++ b/glfw/ibus_glfw.c @@ -46,6 +46,7 @@ #include "internal.h" #include "ibus_glfw.h" +#undef debug #define debug(...) if (_glfw.hints.init.debugKeyboard) printf(__VA_ARGS__); static const char IBUS_SERVICE[] = "org.freedesktop.IBus"; static const char IBUS_PATH[] = "/org/freedesktop/IBus"; diff --git a/glfw/wl_client_side_decorations.c b/glfw/wl_client_side_decorations.c index aaef8206e..afb6e0b1a 100644 --- a/glfw/wl_client_side_decorations.c +++ b/glfw/wl_client_side_decorations.c @@ -13,7 +13,6 @@ #include #include -#define debug(...) if (_glfw.hints.init.debugRendering) fprintf(stderr, __VA_ARGS__); #define decs window->wl.decorations #define ARGB(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index a75b89183..f54759505 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -56,8 +56,6 @@ #endif -#define debug(...) if (_glfw.hints.init.debugRendering) { fprintf(stderr, "[%.3f] ", monotonic_t_to_s_double(monotonic())); fprintf(stderr, __VA_ARGS__); } - static int min(int n1, int n2) { return n1 < n2 ? n1 : n2; diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index 9776f7896..1ad8a406f 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -402,3 +402,4 @@ int _glfwWaylandIntegerWindowScale(_GLFWwindow*); void animateCursorImage(id_type timer_id, void *data); struct wl_cursor* _glfwLoadCursor(GLFWCursorShape, struct wl_cursor_theme*); void destroy_data_offer(_GLFWWaylandDataOffer*); +#define debug(...) if (_glfw.hints.init.debugRendering) { fprintf(stderr, "[%.3f] ", monotonic_t_to_s_double(monotonic())); fprintf(stderr, __VA_ARGS__); } diff --git a/glfw/wl_text_input.c b/glfw/wl_text_input.c index 0a33fe71c..4608d3bfd 100644 --- a/glfw/wl_text_input.c +++ b/glfw/wl_text_input.c @@ -10,6 +10,7 @@ #include "wayland-text-input-unstable-v3-client-protocol.h" #include #include +#undef debug #define debug(...) if (_glfw.hints.init.debugKeyboard) printf(__VA_ARGS__); static struct zwp_text_input_v3* text_input; diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 5d4d57540..9cadcbef9 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -41,7 +41,6 @@ #include #include -#define debug(...) if (_glfw.hints.init.debugRendering) { fprintf(stderr, "[%.3f] ", monotonic_t_to_s_double(monotonic())); fprintf(stderr, __VA_ARGS__); } static GLFWLayerShellConfig layer_shell_config_for_next_window = {0}; diff --git a/glfw/xkb_glfw.c b/glfw/xkb_glfw.c index b35055036..2fa129753 100644 --- a/glfw/xkb_glfw.c +++ b/glfw/xkb_glfw.c @@ -33,6 +33,7 @@ #include #endif +#undef debug #define debug(...) if (_glfw.hints.init.debugKeyboard) fprintf(stderr, __VA_ARGS__); #ifdef XKB_HAS_NO_UTF32