[Mesa-dev] [PATCH 1/4] mesa: Add an ifndef guard around the definition of the INLINE macro

Paul Berry stereotype441 at gmail.com
Tue Jul 19 16:59:38 PDT 2011

On 19 July 2011 13:15, Ian Romanick <idr at freedesktop.org> wrote:
>> src/egl/main/eglcompiler.h
>> src/gallium/include/pipe/p_compiler.h
>> src/mapi/mapi/u_compiler.h
>> src/mesa/main/compiler.h
> None of those headers should ever cross paths.  The only one of those
> that anything under src/mesa/main or src/glsl should *ever* hit is
> src/mesa/main/compiler.h.  Where did the colliding definition come from?

The colliding definition was in src/mapi/mapi/u_compiler.h.  At least
one of the conflicting paths is:

glsl/link_functions.cpp includes
mesa/main/core.h, which includes
mesa/main/mtypes.h, which includes
mapi/glapi/glapi.h, which includes
mapi/glapi/glthread.h, which includes
mapi/mapi/u_thread.h, which includes

mesa/main/core.h also includes

I don't know whether there are other conflicting paths.

This conflict doesn't lead to compile errors right now (presumably
because mesa/main/compiler.h gets included first, and the definition
of INLINE in mapi/mapi/u_compiler.h only happens if INLINE is not
already defined).  However, in patch 2/4 of this patch series, I had
to make glsl/glsl_parser_extras.h include main/mtypes.h (so that I
could add a function to glsl_parser_extras.h that referred to gl_api).
 That must have changed the order in which the files get included so
that mapi/mapi/u_compiler.h got included first.

More information about the mesa-dev mailing list