[Mesa-dev] [PATCH 2/3] android: avoid building errors with stlport

Chih-Wei Huang cwhuang at android-x86.org
Fri Jun 19 09:50:31 PDT 2015


The gallium debugging helpers have defined the assert macro.
It causes some errors when build with Android stlport.

To workaround it, do not include assert.h if the assert macro
has been defined.

Signed-off-by: Chih-Wei Huang <cwhuang at linux.org.tw>
---
 src/gallium/auxiliary/util/u_math.h | 2 ++
 src/util/list.h                     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 3b4040f..f075f1a 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -42,7 +42,9 @@
 #include "pipe/p_compiler.h"
 
 #include "c99_math.h"
+#ifndef assert
 #include <assert.h>
+#endif
 #include <float.h>
 #include <stdarg.h>
 
diff --git a/src/util/list.h b/src/util/list.h
index 9460347..0ba883a 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -40,7 +40,9 @@
 
 #include <stdbool.h>
 #include <stddef.h>
+#ifndef assert
 #include <assert.h>
+#endif
 
 
 struct list_head
-- 
1.9.1



More information about the mesa-dev mailing list