Fixed bug 4797 - SDL fails to compile with Mesa Master (thanks Michael Olbrich!)
authorSylvain Becker <sylvain.becker@gmail.com>
Sat, 12 Oct 2019 18:47:56 +0200
changeset 13111369b01006eb2
parent 13110 4cbaffd0083b
child 13112 8c5d9e937ea8
Fixed bug 4797 - SDL fails to compile with Mesa Master (thanks Michael Olbrich!)

fix building with Mesa 19.2

With Mesa 19.2 building fails with:

/include/GLES/gl.h:63:25: error: conflicting types for 'GLsizeiptr'

The same type is defined in include/SDL_opengl.h for OpenGL and the two
headers should not be included at the same time.
This was just never noticed because the same header guard '__gl_h_' was
used. This was changed in Mesa. The result is this error.

Fix this the same way GLES2 already handles this: Don't include the GLES
header when the OpenGL header was already included.
(https://hg.libsdl.org/SDL/rev/a60b3c292f0f)
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Fri Oct 11 06:18:24 2019 +0200
     1.2 +++ b/src/video/SDL_video.c	Sat Oct 12 18:47:56 2019 +0200
     1.3 @@ -37,9 +37,9 @@
     1.4  #include "SDL_opengl.h"
     1.5  #endif /* SDL_VIDEO_OPENGL */
     1.6  
     1.7 -#if SDL_VIDEO_OPENGL_ES
     1.8 +#if SDL_VIDEO_OPENGL_ES && !SDL_VIDEO_OPENGL
     1.9  #include "SDL_opengles.h"
    1.10 -#endif /* SDL_VIDEO_OPENGL_ES */
    1.11 +#endif /* SDL_VIDEO_OPENGL_ES && !SDL_VIDEO_OPENGL */
    1.12  
    1.13  /* GL and GLES2 headers conflict on Linux 32 bits */
    1.14  #if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL