mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-05 03:08:14 +02:00
Add static asserts to ensure our enums are sizeof(int)
Prevents any ABI suprprises by the enums being expanded to long or shortened to char on special targets. Fixes #11 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
befbf2005c
commit
47d8b2e0b5
2 changed files with 12 additions and 0 deletions
|
|
@ -41,6 +41,12 @@
|
|||
#include "libei-proto.h"
|
||||
#include "brei-shared.h"
|
||||
|
||||
_Static_assert(sizeof(enum ei_device_capability) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum ei_property_permission) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum ei_keymap_type) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum ei_event_type) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum ei_log_priority) == sizeof(int), "Invalid enum size");
|
||||
|
||||
static struct ei_seat *
|
||||
ei_find_seat(struct ei *ei, uint32_t seatid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@
|
|||
#include "libeis-proto.h"
|
||||
#include "libeis-private.h"
|
||||
|
||||
_Static_assert(sizeof(enum eis_device_capability) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum eis_property_permission) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum eis_keymap_type) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum eis_event_type) == sizeof(int), "Invalid enum size");
|
||||
_Static_assert(sizeof(enum eis_log_priority) == sizeof(int), "Invalid enum size");
|
||||
|
||||
static void
|
||||
eis_destroy(struct eis *eis)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue