_Static_assert is the C keyword, the lowercase version is the C++ one.
Add the required configure.ac bits if this is missing.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 configure.ac       | 6 ++++++
 src/evdev-tablet.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8ddc3b6..cfbe024 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,12 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
              [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile libinput")],
              [[#include <time.h>]])
 
+AC_MSG_CHECKING([whether _Static_assert() is supported])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "Test");]])],
+                 [AC_MSG_RESULT([yes])],
+                 [AC_DEFINE(_Static_assert(...), [/* */], [Noop 
_Static_assert() replacement])
+                  AC_MSG_RESULT([no])])
+
 PKG_PROG_PKG_CONFIG()
 PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
 PKG_CHECK_MODULES(LIBUDEV, [libudev])
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 4e8b920..89340bd 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -1187,7 +1187,7 @@ static void
 tablet_mark_all_axes_changed(struct tablet_dispatch *tablet,
                             struct libinput_tablet_tool *tool)
 {
-       static_assert(sizeof(tablet->changed_axes) ==
+       _Static_assert(sizeof(tablet->changed_axes) ==
                              sizeof(tool->axis_caps),
                      "Mismatching array sizes");
 
-- 
2.7.4

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to