[Mesa-dev] [PATCH 4/4] mapi/glapi: Fix glDebugMessageCallbackARB arg type to GLDEBUGPROCARB

jose.r.fonseca at gmail.com jose.r.fonseca at gmail.com
Sun Mar 11 03:47:23 PDT 2012


From: José Fonseca <jose.r.fonseca at gmail.com>

Necessary to prevent type mismatches on MinGW.
---
 src/mapi/glapi/gen/ARB_debug_output.xml |    2 +-
 src/mapi/glapi/gen/gl_API.xml           |    2 ++
 src/mapi/glapi/glapi_mapi_tmp.h         |    6 +++---
 src/mapi/glapi/glapitable.h             |    2 +-
 src/mapi/glapi/glapitemp.h              |    2 +-
 src/mesa/main/dispatch.h                |    4 ++--
 6 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_debug_output.xml b/src/mapi/glapi/gen/ARB_debug_output.xml
index a4b576e..f2877a4 100644
--- a/src/mapi/glapi/gen/ARB_debug_output.xml
+++ b/src/mapi/glapi/gen/ARB_debug_output.xml
@@ -71,7 +71,7 @@
     </function>
 
     <function name="DebugMessageCallbackARB" offset="assign">
-        <param name="callback" type="GLvoid *"/>
+        <param name="callback" type="GLDEBUGPROCARB"/>
         <param name="userParam" type="GLvoid *"/>
     </function>
 
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index eb30719..9f86356 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -1106,6 +1106,8 @@
     
     <type name="void"    size="1"/>
 
+    <type name="DEBUGPROCARB" size="4" pointer="true"/>
+
     <function name="NewList" offset="0">
         <param name="list" type="GLuint"/>
         <param name="mode" type="GLenum"/>
diff --git a/src/mapi/glapi/glapi_mapi_tmp.h b/src/mapi/glapi/glapi_mapi_tmp.h
index cbe5052..647ac9d 100644
--- a/src/mapi/glapi/glapi_mapi_tmp.h
+++ b/src/mapi/glapi/glapi_mapi_tmp.h
@@ -880,7 +880,7 @@ GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, const GLuint *shaders,
 void APIENTRY GLAPI_PREFIX(_dispatch_stub_665)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
 void APIENTRY GLAPI_PREFIX(_dispatch_stub_666)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
 void APIENTRY GLAPI_PREFIX(_dispatch_stub_667)(GLuint program, GLenum pname, GLint value);
-GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLvoid *callback, GLvoid *userParam);
+GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLDEBUGPROCARB callback, GLvoid *userParam);
 GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageControlARB)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
 GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageInsertARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLcharARB *buf);
 GLAPI GLuint APIENTRY GLAPI_PREFIX(GetDebugMessageLogARB)(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLcharARB *messageLog);
@@ -7327,11 +7327,11 @@ GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, const GLuint *shaders,
    ((void (APIENTRY *)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length)) _func)(n, shaders, binaryformat, binary, length);
 }
 
-GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLvoid *callback, GLvoid *userParam)
+GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageCallbackARB)(GLDEBUGPROCARB callback, GLvoid *userParam)
 {
    const struct mapi_table *_tbl = entry_current_get();
    mapi_func _func = ((const mapi_func *) _tbl)[668];
-   ((void (APIENTRY *)(GLvoid *callback, GLvoid *userParam)) _func)(callback, userParam);
+   ((void (APIENTRY *)(GLDEBUGPROCARB callback, GLvoid *userParam)) _func)(callback, userParam);
 }
 
 GLAPI void APIENTRY GLAPI_PREFIX(DebugMessageControlARB)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled)
diff --git a/src/mapi/glapi/glapitable.h b/src/mapi/glapi/glapitable.h
index 617ad46..4bc95cf 100644
--- a/src/mapi/glapi/glapitable.h
+++ b/src/mapi/glapi/glapitable.h
@@ -705,7 +705,7 @@ struct _glapi_table
    void (GLAPIENTRYP GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); /* 662 */
    void (GLAPIENTRYP ReleaseShaderCompiler)(void); /* 663 */
    void (GLAPIENTRYP ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length); /* 664 */
-   void (GLAPIENTRYP DebugMessageCallbackARB)(GLvoid * callback, GLvoid * userParam); /* 665 */
+   void (GLAPIENTRYP DebugMessageCallbackARB)(GLDEBUGPROCARB callback, GLvoid * userParam); /* 665 */
    void (GLAPIENTRYP DebugMessageControlARB)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled); /* 666 */
    void (GLAPIENTRYP DebugMessageInsertARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLcharARB * buf); /* 667 */
    GLuint (GLAPIENTRYP GetDebugMessageLogARB)(GLuint count, GLsizei bufsize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLcharARB * messageLog); /* 668 */
diff --git a/src/mapi/glapi/glapitemp.h b/src/mapi/glapi/glapitemp.h
index 3830f2f..b018c75 100644
--- a/src/mapi/glapi/glapitemp.h
+++ b/src/mapi/glapi/glapitemp.h
@@ -5253,7 +5253,7 @@ KEYWORD1 void KEYWORD2 NAME(ShaderBinary)(GLsizei n, const GLuint * shaders, GLe
    DISPATCH(ShaderBinary, (n, shaders, binaryformat, binary, length), (F, "glShaderBinary(%d, %p, 0x%x, %p, %d);\n", n, (const void *) shaders, binaryformat, (const void *) binary, length));
 }
 
-KEYWORD1 void KEYWORD2 NAME(DebugMessageCallbackARB)(GLvoid * callback, GLvoid * userParam)
+KEYWORD1 void KEYWORD2 NAME(DebugMessageCallbackARB)(GLDEBUGPROCARB callback, GLvoid * userParam)
 {
     (void) callback; (void) userParam;
    DISPATCH(DebugMessageCallbackARB, (callback, userParam), (F, "glDebugMessageCallbackARB(%p, %p);\n", (const void *) callback, (const void *) userParam));
diff --git a/src/mesa/main/dispatch.h b/src/mesa/main/dispatch.h
index a8b349f..6ae69f7 100644
--- a/src/mesa/main/dispatch.h
+++ b/src/mesa/main/dispatch.h
@@ -9508,14 +9508,14 @@ static inline void SET_ShaderBinary(struct _glapi_table *disp, void (GLAPIENTRYP
    SET_by_offset(disp, _gloffset_ShaderBinary, fn);
 }
 
-typedef void (GLAPIENTRYP _glptr_DebugMessageCallbackARB)(GLvoid *, GLvoid *);
+typedef void (GLAPIENTRYP _glptr_DebugMessageCallbackARB)(GLDEBUGPROCARB, GLvoid *);
 #define CALL_DebugMessageCallbackARB(disp, parameters) \
     (* GET_DebugMessageCallbackARB(disp)) parameters
 static inline _glptr_DebugMessageCallbackARB GET_DebugMessageCallbackARB(struct _glapi_table *disp) {
    return (_glptr_DebugMessageCallbackARB) (GET_by_offset(disp, _gloffset_DebugMessageCallbackARB));
 }
 
-static inline void SET_DebugMessageCallbackARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLvoid *, GLvoid *)) {
+static inline void SET_DebugMessageCallbackARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLDEBUGPROCARB, GLvoid *)) {
    SET_by_offset(disp, _gloffset_DebugMessageCallbackARB, fn);
 }
 
-- 
1.7.9.1



More information about the mesa-dev mailing list