[Mesa-dev] [PATCH] glapi: define GL_API to be GLAPI in glapi_dispatch.c

Mathias Fröhlich Mathias.Froehlich at gmx.net
Fri Mar 30 15:39:59 UTC 2018


On Friday, 30 March 2018 16:42:43 CEST Brian Paul wrote:
> This fixes a Windows build warning where the prototypes for the ES
> function in the header file don't match the prototypes in this file
> because the GL_API and GLAPI macros are defined differently.
> ---
>  src/mapi/glapi/glapi_dispatch.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/mapi/glapi/glapi_dispatch.c b/src/mapi/glapi/
glapi_dispatch.c
> index 3239523..f0a8c36 100644
> --- a/src/mapi/glapi/glapi_dispatch.c
> +++ b/src/mapi/glapi/glapi_dispatch.c
> @@ -97,6 +97,11 @@
>   */
>  #include <GLES/glplatform.h>
>  
> +
> +/* Use the GLAPI annotation from GL/gl.h, not GL_API from GLES/gl.h */
> +#undef GL_API
> +#define GL_API GLAPI
> +


Hi Brian,

I wonder if this proposed change introduces some similar warning on some non 
windows builds.

It looks like down in the generated glapitemp.h included down the file, the 
functions get implemented like 

KEYWORD1 <returntype> KEYWORD2 glSomething(...);

So, may be you want to define:

#define GL_API KEYWORD1

to match the prototypes with the implementation?

best
Mathias

>  GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
>  GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat 
*equation);
>  GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat 
bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
> 






More information about the mesa-dev mailing list