[Mesa-dev] [PATCH] gallium/util: fixup libunwind includes

Emil Velikov emil.l.velikov at gmail.com
Wed Apr 5 12:25:14 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Honour the LIBUNWIND_CFLAGS and include the header only where needed.

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