[Mesa-dev] [PATCH] gallium/util: fixup libunwind includes
Rob Clark
robdclark at gmail.com
Wed Apr 5 12:37:46 UTC 2017
On Wed, Apr 5, 2017 at 8:25 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Honour the LIBUNWIND_CFLAGS and include the header only where needed.
Please drop the part other than the Makefile.am hunk..
I'm about to need libunwind.h included in the header file.
BR,
-R
> Cc: Rob Clark <robdclark at gmail.com>
> Fixes: 70c272004f72 ("gallium/util: libunwind support")
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> src/gallium/auxiliary/Makefile.am | 1 +
> src/gallium/auxiliary/util/u_debug_stack.c | 3 +++
> src/gallium/auxiliary/util/u_debug_stack.h | 5 -----
> 3 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
> index def00980308..dc4bd4a40cf 100644
> --- a/src/gallium/auxiliary/Makefile.am
> +++ b/src/gallium/auxiliary/Makefile.am
> @@ -8,6 +8,7 @@ AM_CFLAGS = \
> -I$(top_builddir)/src/compiler/nir \
> -I$(top_srcdir)/src/gallium/auxiliary/util \
> $(GALLIUM_CFLAGS) \
> + $(LIBUNWIND_CFLAGS) \
> $(VISIBILITY_CFLAGS) \
> $(MSVC2013_COMPAT_CFLAGS)
>
> diff --git a/src/gallium/auxiliary/util/u_debug_stack.c b/src/gallium/auxiliary/util/u_debug_stack.c
> index cf05f13ddd0..59d5eb651e4 100644
> --- a/src/gallium/auxiliary/util/u_debug_stack.c
> +++ b/src/gallium/auxiliary/util/u_debug_stack.c
> @@ -38,6 +38,9 @@
>
> #if defined(HAVE_LIBUNWIND)
>
> +#define UNW_LOCAL_ONLY
> +#include <libunwind.h>
> +
> #ifndef _GNU_SOURCE
> #define _GNU_SOURCE
> #endif
> diff --git a/src/gallium/auxiliary/util/u_debug_stack.h b/src/gallium/auxiliary/util/u_debug_stack.h
> index 0effcbe5259..b5b94137536 100644
> --- a/src/gallium/auxiliary/util/u_debug_stack.h
> +++ b/src/gallium/auxiliary/util/u_debug_stack.h
> @@ -30,11 +30,6 @@
>
> #include <stdio.h>
>
> -#ifdef HAVE_LIBUNWIND
> -#define UNW_LOCAL_ONLY
> -#include <libunwind.h>
> -#endif
> -
> /**
> * @file
> * Stack backtracing.
> --
> 2.12.1
>
More information about the mesa-dev
mailing list