On 21 April 2016 at 18:44, Mircea Gherzan <mircea.gher...@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.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to