[PATCH v2 libinput] Add configure.ac check for static_assert

Peter Hutterer peter.hutterer at who-t.net
Mon May 16 03:32:07 UTC 2016


Part of C11, defined via assert.h.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Changes to v1: 
- leave static_assert in place and just check for that in configure

 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 8ddc3b6..8c14efe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,10 @@ AC_CHECK_DECL(TFD_CLOEXEC,[],
 AC_CHECK_DECL(CLOCK_MONOTONIC,[],
 	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile libinput")],
 	      [[#include <time.h>]])
+AC_CHECK_DECL(static_assert, [],
+	      [AC_DEFINE(static_assert(...), [/* */], [noop static_assert() replacement]),
+              AC_MSG_RESULT([no])],
+	      [[#include <assert.h>]])
 
 PKG_PROG_PKG_CONFIG()
 PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
-- 
2.7.4



More information about the wayland-devel mailing list