[Mesa-dev] [PATCH] glx: Fix build warnings for PURE being redefined.

Eric Anholt eric at anholt.net
Wed Jul 22 13:26:09 PDT 2015


We can't completely drop this #define because it's used in the xserver
generated code.  Until someone gets around to putting xml generation
directly in the server, we're stuck #defining it for them.
---
 src/mapi/glapi/gen/gl_XML.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 67aba81..f19570b 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -183,10 +183,12 @@ class gl_print_base(object):
         The name is also added to the file's undef_list.
         """
         self.undef_list.append("PURE")
-        print """#  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-#    define PURE __attribute__((pure))
-#  else
-#    define PURE
+        print """#  if !defined(PURE)
+#    if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#      define PURE __attribute__((pure))
+#    else
+#      define PURE
+#    endif
 #  endif"""
         return
 
-- 
2.1.4



More information about the mesa-dev mailing list