From cc8b6aa3d937dda055cb25fdbec55d0afb6be2a0 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 21 Apr 2020 12:47:56 +0200 Subject: scanner: Guard interface declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows to include client and server headers in the same file fixing warnings like In file included from ../subprojects/wlroots/include/wlr/types/wlr_layer_shell_v1.h:16, from ../src/desktop.h:16, from ../src/server.h:13, from ../tests/testlib.c:8: tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-protocol.h:80:34: warning: redundant redeclaration of ‘zwlr_layer_shell_v1_interface’ [-Wredundant-decls] 80 | extern const struct wl_interface zwlr_layer_shell_v1_interface; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../tests/testlib.h:8, from ../tests/testlib.c:7: tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-client-protocol.h:77:34: note: previous declaration of ‘zwlr_layer_shell_v1_interface’ was here 77 | extern const struct wl_interface zwlr_layer_shell_v1_interface; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../subprojects/wlroots/include/wlr/types/wlr_layer_shell_v1.h:16, from ../src/desktop.h:16, from ../src/server.h:13, from ../tests/testlib.c:8: tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-protocol.h:106:34: warning: redundant redeclaration of ‘zwlr_layer_surface_v1_interface’ [-Wredundant-decls] 106 | extern const struct wl_interface zwlr_layer_surface_v1_interface; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../tests/testlib.h:8, from ../tests/testlib.c:7: tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-client-protocol.h:103:34: note: previous declaration of ‘zwlr_layer_surface_v1_interface’ was here 103 | extern const struct wl_interface zwlr_layer_surface_v1_interface; Signed-off-by: Guido Günther Closes: #158 --- tests/data/example-server.h | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'tests/data/example-server.h') diff --git a/tests/data/example-server.h b/tests/data/example-server.h index adfc973..3311c5d 100644 --- a/tests/data/example-server.h +++ b/tests/data/example-server.h @@ -91,6 +91,8 @@ struct wl_subsurface; struct wl_surface; struct wl_touch; +#ifndef WL_DISPLAY_INTERFACE +#define WL_DISPLAY_INTERFACE /** * @page page_iface_wl_display wl_display * @section page_iface_wl_display_desc Description @@ -107,6 +109,9 @@ struct wl_touch; * is used for internal Wayland protocol features. */ extern const struct wl_interface wl_display_interface; +#endif +#ifndef WL_REGISTRY_INTERFACE +#define WL_REGISTRY_INTERFACE /** * @page page_iface_wl_registry wl_registry * @section page_iface_wl_registry_desc Description @@ -159,6 +164,9 @@ extern const struct wl_interface wl_display_interface; * the object. */ extern const struct wl_interface wl_registry_interface; +#endif +#ifndef WL_CALLBACK_INTERFACE +#define WL_CALLBACK_INTERFACE /** * @page page_iface_wl_callback wl_callback * @section page_iface_wl_callback_desc Description @@ -175,6 +183,9 @@ extern const struct wl_interface wl_registry_interface; * the related request is done. */ extern const struct wl_interface wl_callback_interface; +#endif +#ifndef WL_COMPOSITOR_INTERFACE +#define WL_COMPOSITOR_INTERFACE /** * @page page_iface_wl_compositor wl_compositor * @section page_iface_wl_compositor_desc Description @@ -193,6 +204,9 @@ extern const struct wl_interface wl_callback_interface; * surfaces into one displayable output. */ extern const struct wl_interface wl_compositor_interface; +#endif +#ifndef WL_SHM_POOL_INTERFACE +#define WL_SHM_POOL_INTERFACE /** * @page page_iface_wl_shm_pool wl_shm_pool * @section page_iface_wl_shm_pool_desc Description @@ -219,6 +233,9 @@ extern const struct wl_interface wl_compositor_interface; * a surface or for many small buffers. */ extern const struct wl_interface wl_shm_pool_interface; +#endif +#ifndef WL_SHM_INTERFACE +#define WL_SHM_INTERFACE /** * @page page_iface_wl_shm wl_shm * @section page_iface_wl_shm_desc Description @@ -249,6 +266,9 @@ extern const struct wl_interface wl_shm_pool_interface; * that can be used for buffers. */ extern const struct wl_interface wl_shm_interface; +#endif +#ifndef WL_BUFFER_INTERFACE +#define WL_BUFFER_INTERFACE /** * @page page_iface_wl_buffer wl_buffer * @section page_iface_wl_buffer_desc Description @@ -271,6 +291,9 @@ extern const struct wl_interface wl_shm_interface; * updates the contents is defined by the buffer factory interface. */ extern const struct wl_interface wl_buffer_interface; +#endif +#ifndef WL_DATA_OFFER_INTERFACE +#define WL_DATA_OFFER_INTERFACE /** * @page page_iface_wl_data_offer wl_data_offer * @section page_iface_wl_data_offer_desc Description @@ -295,6 +318,9 @@ extern const struct wl_interface wl_buffer_interface; * data directly from the source client. */ extern const struct wl_interface wl_data_offer_interface; +#endif +#ifndef WL_DATA_SOURCE_INTERFACE +#define WL_DATA_SOURCE_INTERFACE /** * @page page_iface_wl_data_source wl_data_source * @section page_iface_wl_data_source_desc Description @@ -315,6 +341,9 @@ extern const struct wl_interface wl_data_offer_interface; * to requests to transfer the data. */ extern const struct wl_interface wl_data_source_interface; +#endif +#ifndef WL_DATA_DEVICE_INTERFACE +#define WL_DATA_DEVICE_INTERFACE /** * @page page_iface_wl_data_device wl_data_device * @section page_iface_wl_data_device_desc Description @@ -337,6 +366,9 @@ extern const struct wl_interface wl_data_source_interface; * mechanisms such as copy-and-paste and drag-and-drop. */ extern const struct wl_interface wl_data_device_interface; +#endif +#ifndef WL_DATA_DEVICE_MANAGER_INTERFACE +#define WL_DATA_DEVICE_MANAGER_INTERFACE /** * @page page_iface_wl_data_device_manager wl_data_device_manager * @section page_iface_wl_data_device_manager_desc Description @@ -369,6 +401,9 @@ extern const struct wl_interface wl_data_device_interface; * wl_data_offer.accept and wl_data_offer.finish for details. */ extern const struct wl_interface wl_data_device_manager_interface; +#endif +#ifndef WL_SHELL_INTERFACE +#define WL_SHELL_INTERFACE /** * @page page_iface_wl_shell wl_shell * @section page_iface_wl_shell_desc Description @@ -391,6 +426,9 @@ extern const struct wl_interface wl_data_device_manager_interface; * a basic surface. */ extern const struct wl_interface wl_shell_interface; +#endif +#ifndef WL_SHELL_SURFACE_INTERFACE +#define WL_SHELL_SURFACE_INTERFACE /** * @page page_iface_wl_shell_surface wl_shell_surface * @section page_iface_wl_shell_surface_desc Description @@ -425,6 +463,9 @@ extern const struct wl_interface wl_shell_interface; * the wl_surface object. */ extern const struct wl_interface wl_shell_surface_interface; +#endif +#ifndef WL_SURFACE_INTERFACE +#define WL_SURFACE_INTERFACE /** * @page page_iface_wl_surface wl_surface * @section page_iface_wl_surface_desc Description @@ -515,6 +556,9 @@ extern const struct wl_interface wl_shell_surface_interface; * switching is not allowed). */ extern const struct wl_interface wl_surface_interface; +#endif +#ifndef WL_SEAT_INTERFACE +#define WL_SEAT_INTERFACE /** * @page page_iface_wl_seat wl_seat * @section page_iface_wl_seat_desc Description @@ -535,6 +579,9 @@ extern const struct wl_interface wl_surface_interface; * maintains a keyboard focus and a pointer focus. */ extern const struct wl_interface wl_seat_interface; +#endif +#ifndef WL_POINTER_INTERFACE +#define WL_POINTER_INTERFACE /** * @page page_iface_wl_pointer wl_pointer * @section page_iface_wl_pointer_desc Description @@ -563,6 +610,9 @@ extern const struct wl_interface wl_seat_interface; * and scrolling. */ extern const struct wl_interface wl_pointer_interface; +#endif +#ifndef WL_KEYBOARD_INTERFACE +#define WL_KEYBOARD_INTERFACE /** * @page page_iface_wl_keyboard wl_keyboard * @section page_iface_wl_keyboard_desc Description @@ -579,6 +629,9 @@ extern const struct wl_interface wl_pointer_interface; * associated with a seat. */ extern const struct wl_interface wl_keyboard_interface; +#endif +#ifndef WL_TOUCH_INTERFACE +#define WL_TOUCH_INTERFACE /** * @page page_iface_wl_touch wl_touch * @section page_iface_wl_touch_desc Description @@ -607,6 +660,9 @@ extern const struct wl_interface wl_keyboard_interface; * contact point can be identified by the ID of the sequence. */ extern const struct wl_interface wl_touch_interface; +#endif +#ifndef WL_OUTPUT_INTERFACE +#define WL_OUTPUT_INTERFACE /** * @page page_iface_wl_output wl_output * @section page_iface_wl_output_desc Description @@ -631,6 +687,9 @@ extern const struct wl_interface wl_touch_interface; * as global during start up, or when a monitor is hotplugged. */ extern const struct wl_interface wl_output_interface; +#endif +#ifndef WL_REGION_INTERFACE +#define WL_REGION_INTERFACE /** * @page page_iface_wl_region wl_region * @section page_iface_wl_region_desc Description @@ -651,6 +710,9 @@ extern const struct wl_interface wl_output_interface; * regions of a surface. */ extern const struct wl_interface wl_region_interface; +#endif +#ifndef WL_SUBCOMPOSITOR_INTERFACE +#define WL_SUBCOMPOSITOR_INTERFACE /** * @page page_iface_wl_subcompositor wl_subcompositor * @section page_iface_wl_subcompositor_desc Description @@ -701,6 +763,9 @@ extern const struct wl_interface wl_region_interface; * processing to dedicated overlay hardware when possible. */ extern const struct wl_interface wl_subcompositor_interface; +#endif +#ifndef WL_SUBSURFACE_INTERFACE +#define WL_SUBSURFACE_INTERFACE /** * @page page_iface_wl_subsurface wl_subsurface * @section page_iface_wl_subsurface_desc Description @@ -811,6 +876,7 @@ extern const struct wl_interface wl_subcompositor_interface; * unmapped. */ extern const struct wl_interface wl_subsurface_interface; +#endif #ifndef WL_DISPLAY_ERROR_ENUM #define WL_DISPLAY_ERROR_ENUM -- cgit v1.2.3-70-g09d2