Compare commits

...

7 commits
main ... 1.23.1

Author SHA1 Message Date
Simon Ser
a9fec8dd65 build: bump version to 1.23.1 for the bugfix release
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-08-24 17:43:55 +02:00
Joaquim Monteiro
cc34a7a4f1 meson: Fix use of install_data() without specifying install_dir
This was broken (when in a subproject) before Meson 1.3.0, and so
Meson warns against this unless the project targets 1.3.0 or newer.

Signed-off-by: Joaquim Monteiro <joaquim.monteiro@protonmail.com>
(cherry picked from commit 0239b082b9)
2024-08-24 17:43:43 +02:00
Kirill Primak
7e2ec4606e Put WL_DEPRECATED in front of the function declarations
This fixes the following clang error when using C23:

../src/wayland-server-core.h:680:41: error: 'deprecated' attribute cannot be applied to types
  680 |                      int32_t stride, uint32_t format) WL_DEPRECATED;
      |                                                       ^
../src/wayland-util.h:52:25: note: expanded from macro 'WL_DEPRECATED'
   52 | #define WL_DEPRECATED [[deprecated]]
      |                         ^

Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
(cherry picked from commit a6a4e081da)
2024-08-24 17:43:43 +02:00
Sebastian Wick
c5c418de03 client: Handle proxies with no queue
wl_proxy_get_queue can return NULL if the queue of the proxy was already
destroyed with wl_event_queue_destroy. In this case, the queue also has
no name anymore.

Fixes: b42218f ("client: Allow setting names for queues")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
(cherry picked from commit f6f0a3cdec)
2024-08-24 17:43:43 +02:00
Simon Ser
619d99cbba tests: add enum bitfield test
Signed-off-by: Simon Ser <contact@emersion.fr>
(cherry picked from commit fa1811ce3e)
2024-08-24 17:43:43 +02:00
Simon Ser
f72f2aec55 scanner: fix validator for bitfields
Bitfields are valid if the value only contains bits inside of
the supported entries for the given version.

Signed-off-by: Simon Ser <contact@emersion.fr>
(cherry picked from commit c669d99259)
2024-08-24 17:43:43 +02:00
Simon Ser
2b8f9401ee scanner: extract validator function emission to helper function
This function will grow in the next commit.

Signed-off-by: Simon Ser <contact@emersion.fr>
(cherry picked from commit caaa308c0d)
2024-08-24 17:43:43 +02:00
13 changed files with 275 additions and 98 deletions

View file

@ -1,6 +1,6 @@
project( project(
'wayland', 'c', 'wayland', 'c',
version: '1.23.0', version: '1.23.1',
license: 'MIT', license: 'MIT',
meson_version: '>= 0.57.0', meson_version: '>= 0.57.0',
default_options: [ default_options: [
@ -131,7 +131,9 @@ if get_option('scanner')
'wayland-scanner.mk', 'wayland-scanner.mk',
'protocol/wayland.xml', 'protocol/wayland.xml',
'protocol/wayland.dtd', 'protocol/wayland.dtd',
]) ],
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'wayland'),
)
install_data( install_data(
[ 'wayland-scanner.m4' ], [ 'wayland-scanner.m4' ],

View file

@ -1378,6 +1378,50 @@ emit_event_wrappers(struct wl_list *message_list, struct interface *interface)
} }
} }
static void
emit_validator(struct interface *interface, struct enumeration *e)
{
struct entry *entry;
printf("/**\n"
" * @ingroup iface_%s\n"
" * Validate a %s %s value.\n"
" *\n"
" * @return true on success, false on error.\n"
" * @ref %s_%s\n"
" */\n"
"static inline bool\n"
"%s_%s_is_valid(uint32_t value, uint32_t version) {\n",
interface->name, interface->name, e->name,
interface->name, e->name,
interface->name, e->name);
if (e->bitfield) {
printf(" uint32_t valid = 0;\n");
wl_list_for_each(entry, &e->entry_list, link) {
printf(" if (version >= %d)\n"
" valid |= %s_%s_%s;\n",
entry->since,
interface->uppercase_name, e->uppercase_name,
entry->uppercase_name);
}
printf(" return (value & ~valid) == 0;\n");
} else {
printf(" switch (value) {\n");
wl_list_for_each(entry, &e->entry_list, link) {
printf(" case %s%s_%s_%s:\n"
" return version >= %d;\n",
entry->value[0] == '-' ? "(uint32_t)" : "",
interface->uppercase_name, e->uppercase_name,
entry->uppercase_name, entry->since);
}
printf(" default:\n"
" return false;\n"
" }\n");
}
printf("}\n");
}
static void static void
emit_enumerations(struct interface *interface, bool with_validators) emit_enumerations(struct interface *interface, bool with_validators)
{ {
@ -1439,32 +1483,8 @@ emit_enumerations(struct interface *interface, bool with_validators)
} }
if (with_validators) { if (with_validators)
printf("/**\n" emit_validator(interface, e);
" * @ingroup iface_%s\n"
" * Validate a %s %s value.\n"
" *\n"
" * @return true on success, false on error.\n"
" * @ref %s_%s\n"
" */\n"
"static inline bool\n"
"%s_%s_is_valid(uint32_t value, uint32_t version) {\n"
" switch (value) {\n",
interface->name, interface->name, e->name,
interface->name, e->name,
interface->name, e->name);
wl_list_for_each(entry, &e->entry_list, link) {
printf(" case %s%s_%s_%s:\n"
" return version >= %d;\n",
entry->value[0] == '-' ? "(uint32_t)" : "",
interface->uppercase_name, e->uppercase_name,
entry->uppercase_name, entry->since);
}
printf(" default:\n"
" return false;\n"
" }\n"
"}\n");
}
printf("#endif /* %s_%s_ENUM */\n\n", printf("#endif /* %s_%s_ENUM */\n\n",
interface->uppercase_name, e->uppercase_name); interface->uppercase_name, e->uppercase_name);

View file

@ -921,10 +921,14 @@ wl_proxy_marshal_array_flags(struct wl_proxy *proxy, uint32_t opcode,
if (debug_client) { if (debug_client) {
struct wl_event_queue *queue; struct wl_event_queue *queue;
const char *queue_name = NULL;
queue = wl_proxy_get_queue(proxy); queue = wl_proxy_get_queue(proxy);
if (queue)
queue_name = wl_event_queue_get_name(queue);
wl_closure_print(closure, &proxy->object, true, false, NULL, wl_closure_print(closure, &proxy->object, true, false, NULL,
wl_event_queue_get_name(queue)); queue_name);
} }
if (wl_closure_send(closure, proxy->display->connection)) { if (wl_closure_send(closure, proxy->display->connection)) {

View file

@ -674,10 +674,11 @@ wl_display_init_shm(struct wl_display *display);
uint32_t * uint32_t *
wl_display_add_shm_format(struct wl_display *display, uint32_t format); wl_display_add_shm_format(struct wl_display *display, uint32_t format);
WL_DEPRECATED
struct wl_shm_buffer * struct wl_shm_buffer *
wl_shm_buffer_create(struct wl_client *client, wl_shm_buffer_create(struct wl_client *client,
uint32_t id, int32_t width, int32_t height, uint32_t id, int32_t width, int32_t height,
int32_t stride, uint32_t format) WL_DEPRECATED; int32_t stride, uint32_t format);
void void
wl_log_set_handler_server(wl_log_func_t handler); wl_log_set_handler_server(wl_log_func_t handler);

View file

@ -2483,9 +2483,10 @@ wl_priv_signal_final_emit(struct wl_priv_signal *signal, void *data)
/** \cond */ /* Deprecated functions below. */ /** \cond */ /* Deprecated functions below. */
WL_DEPRECATED
uint32_t uint32_t
wl_client_add_resource(struct wl_client *client, wl_client_add_resource(struct wl_client *client,
struct wl_resource *resource) WL_DEPRECATED; struct wl_resource *resource);
WL_EXPORT uint32_t WL_EXPORT uint32_t
wl_client_add_resource(struct wl_client *client, wl_client_add_resource(struct wl_client *client,
@ -2514,11 +2515,12 @@ wl_client_add_resource(struct wl_client *client,
return resource->object.id; return resource->object.id;
} }
WL_DEPRECATED
struct wl_resource * struct wl_resource *
wl_client_add_object(struct wl_client *client, wl_client_add_object(struct wl_client *client,
const struct wl_interface *interface, const struct wl_interface *interface,
const void *implementation, const void *implementation,
uint32_t id, void *data) WL_DEPRECATED; uint32_t id, void *data);
WL_EXPORT struct wl_resource * WL_EXPORT struct wl_resource *
wl_client_add_object(struct wl_client *client, wl_client_add_object(struct wl_client *client,
@ -2537,10 +2539,11 @@ wl_client_add_object(struct wl_client *client,
return resource; return resource;
} }
WL_DEPRECATED
struct wl_resource * struct wl_resource *
wl_client_new_object(struct wl_client *client, wl_client_new_object(struct wl_client *client,
const struct wl_interface *interface, const struct wl_interface *interface,
const void *implementation, void *data) WL_DEPRECATED; const void *implementation, void *data);
WL_EXPORT struct wl_resource * WL_EXPORT struct wl_resource *
wl_client_new_object(struct wl_client *client, wl_client_new_object(struct wl_client *client,
@ -2599,10 +2602,11 @@ wl_client_get_user_data(struct wl_client *client)
return client->data; return client->data;
} }
WL_DEPRECATED
struct wl_global * struct wl_global *
wl_display_add_global(struct wl_display *display, wl_display_add_global(struct wl_display *display,
const struct wl_interface *interface, const struct wl_interface *interface,
void *data, wl_global_bind_func_t bind) WL_DEPRECATED; void *data, wl_global_bind_func_t bind);
WL_EXPORT struct wl_global * WL_EXPORT struct wl_global *
wl_display_add_global(struct wl_display *display, wl_display_add_global(struct wl_display *display,
@ -2612,9 +2616,10 @@ wl_display_add_global(struct wl_display *display,
return wl_global_create(display, interface, interface->version, data, bind); return wl_global_create(display, interface, interface->version, data, bind);
} }
WL_DEPRECATED
void void
wl_display_remove_global(struct wl_display *display, wl_display_remove_global(struct wl_display *display,
struct wl_global *global) WL_DEPRECATED; struct wl_global *global);
WL_EXPORT void WL_EXPORT void
wl_display_remove_global(struct wl_display *display, struct wl_global *global) wl_display_remove_global(struct wl_display *display, struct wl_global *global)

View file

@ -70,30 +70,35 @@ struct wl_resource {
void *data; void *data;
}; };
WL_DEPRECATED
uint32_t uint32_t
wl_client_add_resource(struct wl_client *client, wl_client_add_resource(struct wl_client *client,
struct wl_resource *resource) WL_DEPRECATED; struct wl_resource *resource);
WL_DEPRECATED
struct wl_resource * struct wl_resource *
wl_client_add_object(struct wl_client *client, wl_client_add_object(struct wl_client *client,
const struct wl_interface *interface, const struct wl_interface *interface,
const void *implementation, const void *implementation,
uint32_t id, void *data) WL_DEPRECATED; uint32_t id, void *data);
WL_DEPRECATED
struct wl_resource * struct wl_resource *
wl_client_new_object(struct wl_client *client, wl_client_new_object(struct wl_client *client,
const struct wl_interface *interface, const struct wl_interface *interface,
const void *implementation, void *data) WL_DEPRECATED; const void *implementation, void *data);
WL_DEPRECATED
struct wl_global * struct wl_global *
wl_display_add_global(struct wl_display *display, wl_display_add_global(struct wl_display *display,
const struct wl_interface *interface, const struct wl_interface *interface,
void *data, void *data,
wl_global_bind_func_t bind) WL_DEPRECATED; wl_global_bind_func_t bind);
WL_DEPRECATED
void void
wl_display_remove_global(struct wl_display *display, wl_display_remove_global(struct wl_display *display,
struct wl_global *global) WL_DEPRECATED; struct wl_global *global);
#endif #endif

View file

@ -2396,18 +2396,16 @@ enum wl_data_device_manager_dnd_action {
*/ */
static inline bool static inline bool
wl_data_device_manager_dnd_action_is_valid(uint32_t value, uint32_t version) { wl_data_device_manager_dnd_action_is_valid(uint32_t value, uint32_t version) {
switch (value) { uint32_t valid = 0;
case WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE: if (version >= 1)
return version >= 1; valid |= WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE;
case WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY: if (version >= 1)
return version >= 1; valid |= WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY;
case WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE: if (version >= 1)
return version >= 1; valid |= WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE;
case WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK: if (version >= 1)
return version >= 1; valid |= WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK;
default: return (value & ~valid) == 0;
return false;
}
} }
#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */ #endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
@ -2560,28 +2558,26 @@ enum wl_shell_surface_resize {
*/ */
static inline bool static inline bool
wl_shell_surface_resize_is_valid(uint32_t value, uint32_t version) { wl_shell_surface_resize_is_valid(uint32_t value, uint32_t version) {
switch (value) { uint32_t valid = 0;
case WL_SHELL_SURFACE_RESIZE_NONE: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_NONE;
case WL_SHELL_SURFACE_RESIZE_TOP: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_TOP;
case WL_SHELL_SURFACE_RESIZE_BOTTOM: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_BOTTOM;
case WL_SHELL_SURFACE_RESIZE_LEFT: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_LEFT;
case WL_SHELL_SURFACE_RESIZE_TOP_LEFT: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_TOP_LEFT;
case WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT;
case WL_SHELL_SURFACE_RESIZE_RIGHT: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_RIGHT;
case WL_SHELL_SURFACE_RESIZE_TOP_RIGHT: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_TOP_RIGHT;
case WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT;
default: return (value & ~valid) == 0;
return false;
}
} }
#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */ #endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
@ -2609,12 +2605,10 @@ enum wl_shell_surface_transient {
*/ */
static inline bool static inline bool
wl_shell_surface_transient_is_valid(uint32_t value, uint32_t version) { wl_shell_surface_transient_is_valid(uint32_t value, uint32_t version) {
switch (value) { uint32_t valid = 0;
case WL_SHELL_SURFACE_TRANSIENT_INACTIVE: if (version >= 1)
return version >= 1; valid |= WL_SHELL_SURFACE_TRANSIENT_INACTIVE;
default: return (value & ~valid) == 0;
return false;
}
} }
#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */ #endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
@ -3486,16 +3480,14 @@ enum wl_seat_capability {
*/ */
static inline bool static inline bool
wl_seat_capability_is_valid(uint32_t value, uint32_t version) { wl_seat_capability_is_valid(uint32_t value, uint32_t version) {
switch (value) { uint32_t valid = 0;
case WL_SEAT_CAPABILITY_POINTER: if (version >= 1)
return version >= 1; valid |= WL_SEAT_CAPABILITY_POINTER;
case WL_SEAT_CAPABILITY_KEYBOARD: if (version >= 1)
return version >= 1; valid |= WL_SEAT_CAPABILITY_KEYBOARD;
case WL_SEAT_CAPABILITY_TOUCH: if (version >= 1)
return version >= 1; valid |= WL_SEAT_CAPABILITY_TOUCH;
default: return (value & ~valid) == 0;
return false;
}
} }
#endif /* WL_SEAT_CAPABILITY_ENUM */ #endif /* WL_SEAT_CAPABILITY_ENUM */
@ -4567,14 +4559,12 @@ enum wl_output_mode {
*/ */
static inline bool static inline bool
wl_output_mode_is_valid(uint32_t value, uint32_t version) { wl_output_mode_is_valid(uint32_t value, uint32_t version) {
switch (value) { uint32_t valid = 0;
case WL_OUTPUT_MODE_CURRENT: if (version >= 1)
return version >= 1; valid |= WL_OUTPUT_MODE_CURRENT;
case WL_OUTPUT_MODE_PREFERRED: if (version >= 1)
return version >= 1; valid |= WL_OUTPUT_MODE_PREFERRED;
default: return (value & ~valid) == 0;
return false;
}
} }
#endif /* WL_OUTPUT_MODE_ENUM */ #endif /* WL_OUTPUT_MODE_ENUM */

View file

@ -106,6 +106,29 @@ enum intf_A_foo {
#define INTF_A_FOO_DEPRECATED_SINCE_VERSION 2 #define INTF_A_FOO_DEPRECATED_SINCE_VERSION 2
#endif /* INTF_A_FOO_ENUM */ #endif /* INTF_A_FOO_ENUM */
#ifndef INTF_A_BAR_ENUM
#define INTF_A_BAR_ENUM
enum intf_A_bar {
/**
* this is the first
*/
INTF_A_BAR_FIRST = 0x01,
/**
* this is the second
*/
INTF_A_BAR_SECOND = 0x02,
/**
* this is the third
* @since 2
*/
INTF_A_BAR_THIRD = 0x04,
};
/**
* @ingroup iface_intf_A
*/
#define INTF_A_BAR_THIRD_SINCE_VERSION 2
#endif /* INTF_A_BAR_ENUM */
/** /**
* @ingroup iface_intf_A * @ingroup iface_intf_A
* @struct intf_A_listener * @struct intf_A_listener

View file

@ -106,6 +106,29 @@ enum intf_A_foo {
#define INTF_A_FOO_DEPRECATED_SINCE_VERSION 2 #define INTF_A_FOO_DEPRECATED_SINCE_VERSION 2
#endif /* INTF_A_FOO_ENUM */ #endif /* INTF_A_FOO_ENUM */
#ifndef INTF_A_BAR_ENUM
#define INTF_A_BAR_ENUM
enum intf_A_bar {
/**
* this is the first
*/
INTF_A_BAR_FIRST = 0x01,
/**
* this is the second
*/
INTF_A_BAR_SECOND = 0x02,
/**
* this is the third
* @since 2
*/
INTF_A_BAR_THIRD = 0x04,
};
/**
* @ingroup iface_intf_A
*/
#define INTF_A_BAR_THIRD_SINCE_VERSION 2
#endif /* INTF_A_BAR_ENUM */
/** /**
* @ingroup iface_intf_A * @ingroup iface_intf_A
* @struct intf_A_listener * @struct intf_A_listener

View file

@ -133,6 +133,47 @@ intf_A_foo_is_valid(uint32_t value, uint32_t version) {
} }
#endif /* INTF_A_FOO_ENUM */ #endif /* INTF_A_FOO_ENUM */
#ifndef INTF_A_BAR_ENUM
#define INTF_A_BAR_ENUM
enum intf_A_bar {
/**
* this is the first
*/
INTF_A_BAR_FIRST = 0x01,
/**
* this is the second
*/
INTF_A_BAR_SECOND = 0x02,
/**
* this is the third
* @since 2
*/
INTF_A_BAR_THIRD = 0x04,
};
/**
* @ingroup iface_intf_A
*/
#define INTF_A_BAR_THIRD_SINCE_VERSION 2
/**
* @ingroup iface_intf_A
* Validate a intf_A bar value.
*
* @return true on success, false on error.
* @ref intf_A_bar
*/
static inline bool
intf_A_bar_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
if (version >= 1)
valid |= INTF_A_BAR_FIRST;
if (version >= 1)
valid |= INTF_A_BAR_SECOND;
if (version >= 2)
valid |= INTF_A_BAR_THIRD;
return (value & ~valid) == 0;
}
#endif /* INTF_A_BAR_ENUM */
/** /**
* @ingroup iface_intf_A * @ingroup iface_intf_A
* @struct intf_A_interface * @struct intf_A_interface

View file

@ -133,6 +133,47 @@ intf_A_foo_is_valid(uint32_t value, uint32_t version) {
} }
#endif /* INTF_A_FOO_ENUM */ #endif /* INTF_A_FOO_ENUM */
#ifndef INTF_A_BAR_ENUM
#define INTF_A_BAR_ENUM
enum intf_A_bar {
/**
* this is the first
*/
INTF_A_BAR_FIRST = 0x01,
/**
* this is the second
*/
INTF_A_BAR_SECOND = 0x02,
/**
* this is the third
* @since 2
*/
INTF_A_BAR_THIRD = 0x04,
};
/**
* @ingroup iface_intf_A
*/
#define INTF_A_BAR_THIRD_SINCE_VERSION 2
/**
* @ingroup iface_intf_A
* Validate a intf_A bar value.
*
* @return true on success, false on error.
* @ref intf_A_bar
*/
static inline bool
intf_A_bar_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
if (version >= 1)
valid |= INTF_A_BAR_FIRST;
if (version >= 1)
valid |= INTF_A_BAR_SECOND;
if (version >= 2)
valid |= INTF_A_BAR_THIRD;
return (value & ~valid) == 0;
}
#endif /* INTF_A_BAR_ENUM */
/** /**
* @ingroup iface_intf_A * @ingroup iface_intf_A
* @struct intf_A_interface * @struct intf_A_interface

View file

@ -58,5 +58,12 @@
<entry name="negative" value="-1" since="2" summary="this is a negative value"/> <entry name="negative" value="-1" since="2" summary="this is a negative value"/>
<entry name="deprecated" value="3" since="2" deprecated-since="3" summary="this is a deprecated value"/> <entry name="deprecated" value="3" since="2" deprecated-since="3" summary="this is a deprecated value"/>
</enum> </enum>
<enum name="bar" bitfield="true">
<entry name="first" value="0x01" summary="this is the first"/>
<entry name="second" value="0x02" summary="this is the second"/>
<entry name="third" value="0x04" since="2" summary="this is the third"/>
</enum>
</interface> </interface>
</protocol> </protocol>

View file

@ -10,4 +10,19 @@ main(int argc, char *argv[]) {
assert(intf_A_foo_is_valid(INTF_A_FOO_THIRD, 2)); assert(intf_A_foo_is_valid(INTF_A_FOO_THIRD, 2));
assert(intf_A_foo_is_valid(INTF_A_FOO_NEGATIVE, 2)); assert(intf_A_foo_is_valid(INTF_A_FOO_NEGATIVE, 2));
assert(intf_A_bar_is_valid(INTF_A_BAR_FIRST, 1));
assert(intf_A_bar_is_valid(INTF_A_BAR_FIRST, 2));
assert(intf_A_bar_is_valid(INTF_A_BAR_SECOND, 1));
assert(intf_A_bar_is_valid(INTF_A_BAR_SECOND, 2));
assert(intf_A_bar_is_valid(INTF_A_BAR_FIRST | INTF_A_BAR_SECOND, 1));
assert(intf_A_bar_is_valid(INTF_A_BAR_FIRST | INTF_A_BAR_SECOND, 2));
assert(!intf_A_bar_is_valid(INTF_A_BAR_THIRD, 1));
assert(!intf_A_bar_is_valid(INTF_A_BAR_FIRST | INTF_A_BAR_THIRD, 1));
assert(intf_A_bar_is_valid(INTF_A_BAR_THIRD, 2));
assert(intf_A_bar_is_valid(INTF_A_BAR_FIRST | INTF_A_BAR_THIRD, 2));
assert(!intf_A_bar_is_valid(0xFF, 1));
assert(!intf_A_bar_is_valid(0xFF, 2));
} }