Skip to content

Commit 3383436

Browse files
committed
wayland: Fix libdecor incompatible pointer types
1 parent 2d14a23 commit 3383436

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/video/wayland/SDL_waylandsym.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ SDL_WAYLAND_SYM(xkb_mod_mask_t, xkb_keymap_mod_get_mask, (struct xkb_keymap *, c
175175
#ifdef HAVE_LIBDECOR_H
176176
SDL_WAYLAND_MODULE(WAYLAND_LIBDECOR)
177177
SDL_WAYLAND_SYM(void, libdecor_unref, (struct libdecor *))
178-
SDL_WAYLAND_SYM(struct libdecor *, libdecor_new, (struct wl_display *, struct libdecor_interface *))
178+
SDL_WAYLAND_SYM(struct libdecor *, libdecor_new, (struct wl_display *, const struct libdecor_interface *))
179179
SDL_WAYLAND_SYM(struct libdecor_frame *, libdecor_decorate, (struct libdecor *,\
180180
struct wl_surface *,\
181-
struct libdecor_frame_interface *,\
181+
const struct libdecor_frame_interface *,\
182182
void *))
183183
SDL_WAYLAND_SYM(void, libdecor_frame_unref, (struct libdecor_frame *))
184184
SDL_WAYLAND_SYM(void, libdecor_frame_set_title, (struct libdecor_frame *, const char *))

src/video/wayland/SDL_waylandwindow.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,25 +1476,23 @@ static void decoration_dismiss_popup(struct libdecor_frame *frame, const char *s
14761476
// NOP
14771477
}
14781478

1479+
#if SDL_LIBDECOR_CHECK_VERSION(0, 3, 0)
14791480
static void decoration_frame_bounds(struct libdecor_frame *frame, int width, int height, void *user_data)
14801481
{
14811482
SDL_WindowData *window = (SDL_WindowData *)user_data;
14821483
window->toplevel_bounds.width = width;
14831484
window->toplevel_bounds.height = height;
14841485
}
1485-
1486-
#if SDL_LIBDECOR_CHECK_VERSION(0, 3, 0)
1487-
#define FRAME_BOUNDS_FUNC_CAST(func) func
1488-
#else
1489-
#define FRAME_BOUNDS_FUNC_CAST(func) (void(*)(void))func
14901486
#endif
14911487

14921488
static struct libdecor_frame_interface libdecor_frame_interface = {
14931489
decoration_frame_configure,
14941490
decoration_frame_close,
14951491
decoration_frame_commit,
14961492
decoration_dismiss_popup,
1497-
FRAME_BOUNDS_FUNC_CAST(decoration_frame_bounds)
1493+
#if SDL_LIBDECOR_CHECK_VERSION(0, 3, 0)
1494+
decoration_frame_bounds
1495+
#endif
14981496
};
14991497
#endif
15001498

0 commit comments

Comments
 (0)