shell: Make sure the shell implementation and protocol versions match
This commit is contained in:
@@ -3421,6 +3421,9 @@ xdg_shell_unversioned_dispatch(const void *implementation,
|
|||||||
|
|
||||||
#define XDG_SERVER_VERSION 1
|
#define XDG_SERVER_VERSION 1
|
||||||
|
|
||||||
|
static_assert(XDG_SERVER_VERSION == XDG_SHELL_VERSION_CURRENT,
|
||||||
|
"shell implementation doesn't match protocol version");
|
||||||
|
|
||||||
if (args[0].i != XDG_SERVER_VERSION) {
|
if (args[0].i != XDG_SERVER_VERSION) {
|
||||||
wl_resource_post_error(resource,
|
wl_resource_post_error(resource,
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ extern "C" {
|
|||||||
|
|
||||||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||||
|
|
||||||
|
#ifndef static_assert
|
||||||
|
#define static_assert(cond, msg)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define container_of(ptr, type, member) ({ \
|
#define container_of(ptr, type, member) ({ \
|
||||||
const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
|
const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
|
||||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||||
|
|||||||
Reference in New Issue
Block a user