On 10/16/2013 01:19 PM, Baptist BENOIST wrote:
Hello,

You can find attached a patch to apply on the include/GL/gl.h file.

This patch aims to fix a build issue with GCC when using the -DGL_GLEXT_LEGACY, 
-Werror and -Wundef flags. I have remarked the problem with Qt 5.1.1 (which I 
am packaging for NixOS) but it will occur on any build which combines these 
three flags.

To clarify things:

-Wundef tells the compiler to warn on any use of an undefined definition 
(#define THE_DEFINITION).
-Werror tells the compiler to transform any warning as an error.

With these options, you cannot do:

#if THE_DEFINITION

when THE_DEFINITION has not been previously defined.

You must do:

#if defined(THE_DEFINITION) && THE_DEFINITION


Feel free to ask me anything about this ;-)


diff -rupN Mesa-9.2.0-orig/include/GL/gl.h Mesa-9.2.0/include/GL/gl.h
--- Mesa-9.2.0-orig/include/GL/gl.h     2013-08-14 03:34:42.000000000 +0200
+++ Mesa-9.2.0/include/GL/gl.h  2013-09-24 19:34:58.319140812 +0200
@@ -2088,7 +2088,7 @@ typedef void (APIENTRYP PFNGLMULTITEXCOO



-#if GL_ARB_shader_objects
+#if defined(GL_ARB_shaders_objects) && GL_ARB_shader_objects

 #ifndef GL_MESA_shader_debug
 #define GL_MESA_shader_debug 1


Actually, I think it could be safely changed to just

#ifdef GL_ARB_shader_objects

Would that be OK?

Going further, I think we could just remove all the GL_MESA_shader_debug stuff from Mesa. It's an old extension that's never really been used. I'll put it on my to-do list.

-Brian


-Brian

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to