fixed wayland cgo compilation bug

This commit is contained in:
Roland Singer 2017-11-28 12:33:35 +01:00
parent 0ac55844c9
commit 726ebb1718
2 changed files with 12 additions and 5 deletions

View file

@ -31,7 +31,7 @@
extern const struct wl_interface wl_pointer_interface; extern const struct wl_interface wl_pointer_interface;
extern const struct wl_interface zwp_relative_pointer_v1_interface; extern const struct wl_interface zwp_relative_pointer_v1_interface;
static const struct wl_interface *types[] = { static const struct wl_interface *types2[] = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
@ -43,8 +43,8 @@ static const struct wl_interface *types[] = {
}; };
static const struct wl_message zwp_relative_pointer_manager_v1_requests[] = { static const struct wl_message zwp_relative_pointer_manager_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", types2 + 0 },
{ "get_relative_pointer", "no", types + 6 }, { "get_relative_pointer", "no", types2 + 6 },
}; };
WL_EXPORT const struct wl_interface zwp_relative_pointer_manager_v1_interface = { WL_EXPORT const struct wl_interface zwp_relative_pointer_manager_v1_interface = {
@ -54,11 +54,11 @@ WL_EXPORT const struct wl_interface zwp_relative_pointer_manager_v1_interface =
}; };
static const struct wl_message zwp_relative_pointer_v1_requests[] = { static const struct wl_message zwp_relative_pointer_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", types2 + 0 },
}; };
static const struct wl_message zwp_relative_pointer_v1_events[] = { static const struct wl_message zwp_relative_pointer_v1_events[] = {
{ "relative_motion", "uuffff", types + 0 }, { "relative_motion", "uuffff", types2 + 0 },
}; };
WL_EXPORT const struct wl_interface zwp_relative_pointer_v1_interface = { WL_EXPORT const struct wl_interface zwp_relative_pointer_v1_interface = {

View file

@ -7,6 +7,10 @@ cd $TMPDIR
git clone https://github.com/wayland-project/wayland-protocols git clone https://github.com/wayland-project/wayland-protocols
cd wayland-protocols cd wayland-protocols
rm -f "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.{h,c}
rm -f "$GLGLFW_PATH"/wayland-relative-pointer-unstable-v1-client-protocol.{h,c}
rm -f "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.{h,c}
wayland-scanner code ./unstable/pointer-constraints/pointer-constraints-unstable-v1.xml "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.c wayland-scanner code ./unstable/pointer-constraints/pointer-constraints-unstable-v1.xml "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.c
wayland-scanner client-header ./unstable/pointer-constraints/pointer-constraints-unstable-v1.xml "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.h wayland-scanner client-header ./unstable/pointer-constraints/pointer-constraints-unstable-v1.xml "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.h
@ -15,3 +19,6 @@ wayland-scanner client-header ./unstable/relative-pointer/relative-pointer-unsta
wayland-scanner code ./unstable/idle-inhibit/idle-inhibit-unstable-v1.xml "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.c wayland-scanner code ./unstable/idle-inhibit/idle-inhibit-unstable-v1.xml "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.c
wayland-scanner client-header ./unstable/idle-inhibit/idle-inhibit-unstable-v1.xml "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.h wayland-scanner client-header ./unstable/idle-inhibit/idle-inhibit-unstable-v1.xml "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.h
# Patch for cgo
sed -i "s|types|types2|g" "$GLGLFW_PATH"/wayland-relative-pointer-unstable-v1-client-protocol.c