[Mesa-dev] [PATCH] mesa/st: Include nir.h for nir_shader symbol.
Rob Clark
robdclark at gmail.com
Tue Jun 28 14:51:27 UTC 2016
On Mon, Jun 27, 2016 at 10:08 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Mon, Jun 27, 2016 at 6:45 PM, Vinson Lee <vlee at freedesktop.org> wrote:
>> Fix this build error with GCC 4.4.
>>
>> CC state_tracker/st_nir_lower_builtin.lo
>> In file included from state_tracker/st_nir_lower_builtin.c:61:
>> state_tracker/st_nir.h:34: error: redefinition of typedef ‘nir_shader’
>> ../../src/compiler/nir/nir.h:1830: note: previous declaration of ‘nir_shader’ was here
>
> This error seems to imply that nir.h is already being included somehow.
>
> Does just removing the typedef solve the problem? Can we figure out
> how nir.h is already being included and remove that?
nir.h is coming from st_nir_lower_builtin.c which #includes st_nir.h..
Perhaps the thing to do is drop the typedef, and just fwd declare
'struct nir_shader', and use 'struct nir_shader' instead of
'nir_shader' in st_nir.h
Already half of the world gets recompiled when you touch nir.h, and
I'd rather not make that worse..
BR,
-R
More information about the mesa-dev
mailing list