[Mesa-dev] [PATCH] ir_to_mesa: Include main/compiler.h

Jakob Bornecrantz jakob at vmware.com
Thu Aug 12 10:40:47 PDT 2010

Needed for Elements. Need to have its own extern block before other includes
due to conflicts with other headers which define similar thingsi. In
particular mapi/mapi/u_compiler.h will get included before main/compiler.h and
main/compiler.h doesn't check if INLINE is already defined so we get warnings.

The proper fix tho is to create a shared src/utils or something where all
these kind of things can go. And we have talked about it in the past just
never got around to it.

This patch is only needed if you merge in master to the glsl2 branch I'm
guessing this is due to Vinson's include changes not that they are bad. Also
this patch doesn't break the build if applied to a unmerged glsl2 branch so
it probably okay to apply directly.

Cheers Jakob.
 src/mesa/program/ir_to_mesa.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index a9a6f97..54c75b1 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -30,6 +30,10 @@
  * printing the result
+extern "C" {
+#include "main/compiler.h"
 #include <stdio.h>
 #include "ir.h"
 #include "ir_visitor.h"

More information about the mesa-dev mailing list