[Mesa-dev] [PATCH] include/GL: fix the interop header for a --disable-glx build

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 21 18:28:56 UTC 2016


On 21 April 2016 at 18:44, Mircea Gherzan <mircea.gherzan at intel.com> wrote:

>>> +#ifdef MESA_EGL_NO_X11_HEADERS
>>> +#include <GL/gl.h>
>>> +#else
>>>  #include <GL/glx.h>
>>> +#endif
>>> +
>>>  #include <EGL/egl.h>
>>>
>> Drop the includes altogether, and forward declare the needed symbols.
>
>
> Why not use the configure.ac-based approach suggested by Chuck?
>
Few reasons come to mind:

Files filled with #ifdef spaghetti are perceived, by many, as messy.
Not to mention that every user will need a check analogous to the one
in configure.ac.

In general you should not include other headers unless you need to
know the details behind given struct/enum/other. Using this approach
improves build times, amongst other things ;-)

Emil
P.S. Hopefully I'm not "flogging a dead horse" here.


More information about the mesa-dev mailing list