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

2016-05-16 Thread Baruch Siach
Hi Peter,

On Mon, May 16, 2016 at 01:32:07PM +1000, Peter Hutterer wrote:
> Part of C11, defined via assert.h.
> 
> Signed-off-by: Peter Hutterer 

This fixes the build using a uClibc-ng toolchain that does not define the 
static_assert macro.

Tested-by: Baruch Siach 

Thanks,
baruch

> ---
> 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 ]])
> +AC_CHECK_DECL(static_assert, [],
> +   [AC_DEFINE(static_assert(...), [/* */], [noop static_assert() 
> replacement]),
> +  AC_MSG_RESULT([no])],
> +   [[#include ]])
>  
>  PKG_PROG_PKG_CONFIG()
>  PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
> -- 
> 2.7.4
> 

-- 
 http://baruch.siach.name/blog/  ~. .~   Tk Open Systems
=}ooO--U--Ooo{=
   - bar...@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2016-05-15 Thread Thiago Macieira
On segunda-feira, 16 de maio de 2016 13:32:07 PDT Peter Hutterer wrote:
> Part of C11, defined via assert.h.
> 
> Signed-off-by: Peter Hutterer 
> ---
> 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 ]])
> +AC_CHECK_DECL(static_assert, [],
> +   [AC_DEFINE(static_assert(...), [/* */], [noop static_assert()

You could define it to
#define static_assert(x)((void)sizeof(char[2*!!(x) - 1]))


-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

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


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

2016-05-15 Thread Jonas Ådahl
On Mon, May 16, 2016 at 01:32:07PM +1000, Peter Hutterer wrote:
> Part of C11, defined via assert.h.
> 
> Signed-off-by: Peter Hutterer 

Reviewed-by: Jonas Ådahl 

> ---
> 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 ]])
> +AC_CHECK_DECL(static_assert, [],
> +   [AC_DEFINE(static_assert(...), [/* */], [noop static_assert() 
> replacement]),
> +  AC_MSG_RESULT([no])],
> +   [[#include ]])
>  
>  PKG_PROG_PKG_CONFIG()
>  PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
> -- 
> 2.7.4
> 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2016-05-15 Thread Peter Hutterer
Part of C11, defined via assert.h.

Signed-off-by: Peter Hutterer 
---
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 ]])
+AC_CHECK_DECL(static_assert, [],
+ [AC_DEFINE(static_assert(...), [/* */], [noop static_assert() 
replacement]),
+  AC_MSG_RESULT([no])],
+ [[#include ]])
 
 PKG_PROG_PKG_CONFIG()
 PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
-- 
2.7.4

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