From d57808385ce0a377e62a8fdf1d93f2616b496089 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 28 Oct 2016 06:23:02 +0530 Subject: [PATCH] gstgl: Re-enable WINAPI on _MSC_VER The calling convention may be deprecated, but we still need it for OpenGL. The build issue was caused by an incorrect syntax being used for the WINAPI (__stdcall) prototype in function pointers which was accepted by GCC but is rejected by MSVC. --- gst-libs/gst/gl/gstglapi.h | 2 +- gst-libs/gst/gl/gstglshader.c | 24 ++++++++++++------------ gst-libs/gst/gl/gstglsl_private.h | 24 ++++++++++++------------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gst-libs/gst/gl/gstglapi.h b/gst-libs/gst/gl/gstglapi.h index fd8d9a6489..3088920020 100644 --- a/gst-libs/gst/gl/gstglapi.h +++ b/gst-libs/gst/gl/gstglapi.h @@ -76,7 +76,7 @@ #pragma GCC diagnostic pop #endif -#if defined(WINAPI) && !defined(_MSC_VER) +#if defined(WINAPI) #define GSTGLAPI WINAPI #else #define GSTGLAPI diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index 9f092369a7..c16130800d 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -48,22 +48,22 @@ typedef struct _GstGLShaderVTable { - GLuint GSTGLAPI (*CreateProgram) (void); - void GSTGLAPI (*DeleteProgram) (GLuint program); - void GSTGLAPI (*UseProgram) (GLuint program); - void GSTGLAPI (*GetAttachedShaders) (GLuint program, GLsizei maxcount, + GLuint (GSTGLAPI *CreateProgram) (void); + void (GSTGLAPI *DeleteProgram) (GLuint program); + void (GSTGLAPI *UseProgram) (GLuint program); + void (GSTGLAPI *GetAttachedShaders) (GLuint program, GLsizei maxcount, GLsizei * count, GLuint * shaders); - GLuint GSTGLAPI (*CreateShader) (GLenum shaderType); - void GSTGLAPI (*DeleteShader) (GLuint shader); - void GSTGLAPI (*AttachShader) (GLuint program, GLuint shader); - void GSTGLAPI (*DetachShader) (GLuint program, GLuint shader); + GLuint (GSTGLAPI *CreateShader) (GLenum shaderType); + void (GSTGLAPI *DeleteShader) (GLuint shader); + void (GSTGLAPI *AttachShader) (GLuint program, GLuint shader); + void (GSTGLAPI *DetachShader) (GLuint program, GLuint shader); - void GSTGLAPI (*GetShaderiv) (GLuint program, GLenum pname, GLint * params); - void GSTGLAPI (*GetProgramiv) (GLuint program, GLenum pname, GLint * params); - void GSTGLAPI (*GetShaderInfoLog) (GLuint shader, GLsizei maxLength, + void (GSTGLAPI *GetShaderiv) (GLuint program, GLenum pname, GLint * params); + void (GSTGLAPI *GetProgramiv) (GLuint program, GLenum pname, GLint * params); + void (GSTGLAPI *GetShaderInfoLog) (GLuint shader, GLsizei maxLength, GLsizei * length, char *log); - void GSTGLAPI (*GetProgramInfoLog) (GLuint shader, GLsizei maxLength, + void (GSTGLAPI *GetProgramInfoLog) (GLuint shader, GLsizei maxLength, GLsizei * length, char *log); } GstGLShaderVTable; diff --git a/gst-libs/gst/gl/gstglsl_private.h b/gst-libs/gst/gl/gstglsl_private.h index 755170dfaa..08addeb8cc 100644 --- a/gst-libs/gst/gl/gstglsl_private.h +++ b/gst-libs/gst/gl/gstglsl_private.h @@ -36,22 +36,22 @@ typedef struct _GstGLSLFuncs { gboolean initialized; - GLuint GSTGLAPI (*CreateProgram) (void); - void GSTGLAPI (*DeleteProgram) (GLuint program); - void GSTGLAPI (*UseProgram) (GLuint program); - void GSTGLAPI (*GetAttachedShaders) (GLuint program, GLsizei maxcount, + GLuint (GSTGLAPI *CreateProgram) (void); + void (GSTGLAPI *DeleteProgram) (GLuint program); + void (GSTGLAPI *UseProgram) (GLuint program); + void (GSTGLAPI *GetAttachedShaders) (GLuint program, GLsizei maxcount, GLsizei * count, GLuint * shaders); - GLuint GSTGLAPI (*CreateShader) (GLenum shaderType); - void GSTGLAPI (*DeleteShader) (GLuint shader); - void GSTGLAPI (*AttachShader) (GLuint program, GLuint shader); - void GSTGLAPI (*DetachShader) (GLuint program, GLuint shader); + GLuint (GSTGLAPI *CreateShader) (GLenum shaderType); + void (GSTGLAPI *DeleteShader) (GLuint shader); + void (GSTGLAPI *AttachShader) (GLuint program, GLuint shader); + void (GSTGLAPI *DetachShader) (GLuint program, GLuint shader); - void GSTGLAPI (*GetShaderiv) (GLuint program, GLenum pname, GLint * params); - void GSTGLAPI (*GetProgramiv) (GLuint program, GLenum pname, GLint * params); - void GSTGLAPI (*GetShaderInfoLog) (GLuint shader, GLsizei maxLength, + void (GSTGLAPI *GetShaderiv) (GLuint program, GLenum pname, GLint * params); + void (GSTGLAPI *GetProgramiv) (GLuint program, GLenum pname, GLint * params); + void (GSTGLAPI *GetShaderInfoLog) (GLuint shader, GLsizei maxLength, GLsizei * length, char *log); - void GSTGLAPI (*GetProgramInfoLog) (GLuint shader, GLsizei maxLength, + void (GSTGLAPI *GetProgramInfoLog) (GLuint shader, GLsizei maxLength, GLsizei * length, char *log); } GstGLSLFuncs;