From a7ba5dd9df4f52efa9ae575edcc3f90cb211968b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 8 Nov 2022 01:02:33 +0100 Subject: [PATCH] Change xdg-shell to private-code. --- profiler/src/wayland/xdg-shell.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/profiler/src/wayland/xdg-shell.c b/profiler/src/wayland/xdg-shell.c index 7c9c3cc5..d2fde497 100644 --- a/profiler/src/wayland/xdg-shell.c +++ b/profiler/src/wayland/xdg-shell.c @@ -32,6 +32,16 @@ #include #include "wayland-util.h" +#ifndef __has_attribute +# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ +#endif + +#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) +#define WL_PRIVATE __attribute__ ((visibility("hidden"))) +#else +#define WL_PRIVATE +#endif + extern const struct wl_interface wl_output_interface; extern const struct wl_interface wl_seat_interface; extern const struct wl_interface wl_surface_interface; @@ -80,7 +90,7 @@ static const struct wl_message xdg_wm_base_events[] = { { "ping", "u", xdg_shell_types + 0 }, }; -WL_EXPORT const struct wl_interface xdg_wm_base_interface = { +WL_PRIVATE const struct wl_interface xdg_wm_base_interface = { "xdg_wm_base", 5, 4, xdg_wm_base_requests, 1, xdg_wm_base_events, @@ -99,7 +109,7 @@ static const struct wl_message xdg_positioner_requests[] = { { "set_parent_configure", "3u", xdg_shell_types + 0 }, }; -WL_EXPORT const struct wl_interface xdg_positioner_interface = { +WL_PRIVATE const struct wl_interface xdg_positioner_interface = { "xdg_positioner", 5, 10, xdg_positioner_requests, 0, NULL, @@ -117,7 +127,7 @@ static const struct wl_message xdg_surface_events[] = { { "configure", "u", xdg_shell_types + 0 }, }; -WL_EXPORT const struct wl_interface xdg_surface_interface = { +WL_PRIVATE const struct wl_interface xdg_surface_interface = { "xdg_surface", 5, 5, xdg_surface_requests, 1, xdg_surface_events, @@ -147,7 +157,7 @@ static const struct wl_message xdg_toplevel_events[] = { { "wm_capabilities", "5a", xdg_shell_types + 0 }, }; -WL_EXPORT const struct wl_interface xdg_toplevel_interface = { +WL_PRIVATE const struct wl_interface xdg_toplevel_interface = { "xdg_toplevel", 5, 14, xdg_toplevel_requests, 4, xdg_toplevel_events, @@ -165,7 +175,7 @@ static const struct wl_message xdg_popup_events[] = { { "repositioned", "3u", xdg_shell_types + 0 }, }; -WL_EXPORT const struct wl_interface xdg_popup_interface = { +WL_PRIVATE const struct wl_interface xdg_popup_interface = { "xdg_popup", 5, 3, xdg_popup_requests, 3, xdg_popup_events,