Use GL_APIENTRY and EGLAPIENTRY instead of __stdcall directly.

BUG=angleproject:773

Change-Id: Iab098f787b966bf3999c22687af113cc9909593b
Reviewed-on: https://chromium-review.googlesource.com/221796
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Kenneth Russell <kbr@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index defe06b..2bb2d39 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -35,7 +35,7 @@
 
 // OpenGL ES 2.0 functions
 
-void __stdcall glActiveTexture(GLenum texture)
+void GL_APIENTRY glActiveTexture(GLenum texture)
 {
     EVENT("(GLenum texture = 0x%X)", texture);
 
@@ -52,7 +52,7 @@
     }
 }
 
-void __stdcall glAttachShader(GLuint program, GLuint shader)
+void GL_APIENTRY glAttachShader(GLuint program, GLuint shader)
 {
     EVENT("(GLuint program = %d, GLuint shader = %d)", program, shader);
 
@@ -98,7 +98,7 @@
     }
 }
 
-void __stdcall glBeginQueryEXT(GLenum target, GLuint id)
+void GL_APIENTRY glBeginQueryEXT(GLenum target, GLuint id)
 {
     EVENT("(GLenum target = 0x%X, GLuint %d)", target, id);
 
@@ -119,7 +119,7 @@
     }
 }
 
-void __stdcall glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
+void GL_APIENTRY glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
 {
     EVENT("(GLuint program = %d, GLuint index = %d, const GLchar* name = 0x%0.8p)", program, index, name);
 
@@ -158,7 +158,7 @@
     }
 }
 
-void __stdcall glBindBuffer(GLenum target, GLuint buffer)
+void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer)
 {
     EVENT("(GLenum target = 0x%X, GLuint buffer = %d)", target, buffer);
 
@@ -205,7 +205,7 @@
     }
 }
 
-void __stdcall glBindFramebuffer(GLenum target, GLuint framebuffer)
+void GL_APIENTRY glBindFramebuffer(GLenum target, GLuint framebuffer)
 {
     EVENT("(GLenum target = 0x%X, GLuint framebuffer = %d)", target, framebuffer);
 
@@ -230,7 +230,7 @@
     }
 }
 
-void __stdcall glBindRenderbuffer(GLenum target, GLuint renderbuffer)
+void GL_APIENTRY glBindRenderbuffer(GLenum target, GLuint renderbuffer)
 {
     EVENT("(GLenum target = 0x%X, GLuint renderbuffer = %d)", target, renderbuffer);
 
@@ -247,7 +247,7 @@
     }
 }
 
-void __stdcall glBindTexture(GLenum target, GLuint texture)
+void GL_APIENTRY glBindTexture(GLenum target, GLuint texture)
 {
     EVENT("(GLenum target = 0x%X, GLuint texture = %d)", target, texture);
 
@@ -286,7 +286,7 @@
     }
 }
 
-void __stdcall glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
 {
     EVENT("(GLclampf red = %f, GLclampf green = %f, GLclampf blue = %f, GLclampf alpha = %f)",
           red, green, blue, alpha);
@@ -299,12 +299,12 @@
     }
 }
 
-void __stdcall glBlendEquation(GLenum mode)
+void GL_APIENTRY glBlendEquation(GLenum mode)
 {
     glBlendEquationSeparate(mode, mode);
 }
 
-void __stdcall glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
+void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
 {
     EVENT("(GLenum modeRGB = 0x%X, GLenum modeAlpha = 0x%X)", modeRGB, modeAlpha);
 
@@ -343,12 +343,12 @@
     }
 }
 
-void __stdcall glBlendFunc(GLenum sfactor, GLenum dfactor)
+void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
 {
     glBlendFuncSeparate(sfactor, dfactor, sfactor, dfactor);
 }
 
-void __stdcall glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+void GL_APIENTRY glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
 {
     EVENT("(GLenum srcRGB = 0x%X, GLenum dstRGB = 0x%X, GLenum srcAlpha = 0x%X, GLenum dstAlpha = 0x%X)",
           srcRGB, dstRGB, srcAlpha, dstAlpha);
@@ -483,7 +483,7 @@
     }
 }
 
-void __stdcall glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+void GL_APIENTRY glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
 {
     EVENT("(GLenum target = 0x%X, GLsizeiptr size = %d, const GLvoid* data = 0x%0.8p, GLenum usage = %d)",
           target, size, data, usage);
@@ -545,7 +545,7 @@
     }
 }
 
-void __stdcall glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
+void GL_APIENTRY glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
 {
     EVENT("(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr size = %d, const GLvoid* data = 0x%0.8p)",
           target, offset, size, data);
@@ -606,7 +606,7 @@
     }
 }
 
-GLenum __stdcall glCheckFramebufferStatus(GLenum target)
+GLenum GL_APIENTRY glCheckFramebufferStatus(GLenum target)
 {
     EVENT("(GLenum target = 0x%X)", target);
 
@@ -627,7 +627,7 @@
     return 0;
 }
 
-void __stdcall glClear(GLbitfield mask)
+void GL_APIENTRY glClear(GLbitfield mask)
 {
     EVENT("(GLbitfield mask = 0x%X)", mask);
 
@@ -657,7 +657,7 @@
     }
 }
 
-void __stdcall glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+void GL_APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
 {
     EVENT("(GLclampf red = %f, GLclampf green = %f, GLclampf blue = %f, GLclampf alpha = %f)",
           red, green, blue, alpha);
@@ -669,7 +669,7 @@
     }
 }
 
-void __stdcall glClearDepthf(GLclampf depth)
+void GL_APIENTRY glClearDepthf(GLclampf depth)
 {
     EVENT("(GLclampf depth = %f)", depth);
 
@@ -680,7 +680,7 @@
     }
 }
 
-void __stdcall glClearStencil(GLint s)
+void GL_APIENTRY glClearStencil(GLint s)
 {
     EVENT("(GLint s = %d)", s);
 
@@ -691,7 +691,7 @@
     }
 }
 
-void __stdcall glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+void GL_APIENTRY glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
 {
     EVENT("(GLboolean red = %d, GLboolean green = %u, GLboolean blue = %u, GLboolean alpha = %u)",
           red, green, blue, alpha);
@@ -703,7 +703,7 @@
     }
 }
 
-void __stdcall glCompileShader(GLuint shader)
+void GL_APIENTRY glCompileShader(GLuint shader)
 {
     EVENT("(GLuint shader = %d)", shader);
 
@@ -730,7 +730,7 @@
     }
 }
 
-void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
+void GL_APIENTRY glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
                                       GLint border, GLsizei imageSize, const GLvoid* data)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = %d, "
@@ -799,7 +799,7 @@
     }
 }
 
-void __stdcall glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+void GL_APIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
                                          GLenum format, GLsizei imageSize, const GLvoid* data)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
@@ -869,7 +869,7 @@
     }
 }
 
-void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+void GL_APIENTRY glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, "
           "GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLint border = %d)",
@@ -922,7 +922,7 @@
     }
 }
 
-void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+void GL_APIENTRY glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
           "GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
@@ -975,7 +975,7 @@
     }
 }
 
-GLuint __stdcall glCreateProgram(void)
+GLuint GL_APIENTRY glCreateProgram(void)
 {
     EVENT("()");
 
@@ -988,7 +988,7 @@
     return 0;
 }
 
-GLuint __stdcall glCreateShader(GLenum type)
+GLuint GL_APIENTRY glCreateShader(GLenum type)
 {
     EVENT("(GLenum type = 0x%X)", type);
 
@@ -1010,7 +1010,7 @@
     return 0;
 }
 
-void __stdcall glCullFace(GLenum mode)
+void GL_APIENTRY glCullFace(GLenum mode)
 {
     EVENT("(GLenum mode = 0x%X)", mode);
 
@@ -1033,7 +1033,7 @@
     }
 }
 
-void __stdcall glDeleteBuffers(GLsizei n, const GLuint* buffers)
+void GL_APIENTRY glDeleteBuffers(GLsizei n, const GLuint* buffers)
 {
     EVENT("(GLsizei n = %d, const GLuint* buffers = 0x%0.8p)", n, buffers);
 
@@ -1053,7 +1053,7 @@
     }
 }
 
-void __stdcall glDeleteFencesNV(GLsizei n, const GLuint* fences)
+void GL_APIENTRY glDeleteFencesNV(GLsizei n, const GLuint* fences)
 {
     EVENT("(GLsizei n = %d, const GLuint* fences = 0x%0.8p)", n, fences);
 
@@ -1073,7 +1073,7 @@
     }
 }
 
-void __stdcall glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
+void GL_APIENTRY glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
 {
     EVENT("(GLsizei n = %d, const GLuint* framebuffers = 0x%0.8p)", n, framebuffers);
 
@@ -1096,7 +1096,7 @@
     }
 }
 
-void __stdcall glDeleteProgram(GLuint program)
+void GL_APIENTRY glDeleteProgram(GLuint program)
 {
     EVENT("(GLuint program = %d)", program);
 
@@ -1126,7 +1126,7 @@
     }
 }
 
-void __stdcall glDeleteQueriesEXT(GLsizei n, const GLuint *ids)
+void GL_APIENTRY glDeleteQueriesEXT(GLsizei n, const GLuint *ids)
 {
     EVENT("(GLsizei n = %d, const GLuint *ids = 0x%0.8p)", n, ids);
 
@@ -1146,7 +1146,7 @@
     }
 }
 
-void __stdcall glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
+void GL_APIENTRY glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
 {
     EVENT("(GLsizei n = %d, const GLuint* renderbuffers = 0x%0.8p)", n, renderbuffers);
 
@@ -1166,7 +1166,7 @@
     }
 }
 
-void __stdcall glDeleteShader(GLuint shader)
+void GL_APIENTRY glDeleteShader(GLuint shader)
 {
     EVENT("(GLuint shader = %d)", shader);
 
@@ -1196,7 +1196,7 @@
     }
 }
 
-void __stdcall glDeleteTextures(GLsizei n, const GLuint* textures)
+void GL_APIENTRY glDeleteTextures(GLsizei n, const GLuint* textures)
 {
     EVENT("(GLsizei n = %d, const GLuint* textures = 0x%0.8p)", n, textures);
 
@@ -1219,7 +1219,7 @@
     }
 }
 
-void __stdcall glDepthFunc(GLenum func)
+void GL_APIENTRY glDepthFunc(GLenum func)
 {
     EVENT("(GLenum func = 0x%X)", func);
 
@@ -1246,7 +1246,7 @@
     }
 }
 
-void __stdcall glDepthMask(GLboolean flag)
+void GL_APIENTRY glDepthMask(GLboolean flag)
 {
     EVENT("(GLboolean flag = %u)", flag);
 
@@ -1257,7 +1257,7 @@
     }
 }
 
-void __stdcall glDepthRangef(GLclampf zNear, GLclampf zFar)
+void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar)
 {
     EVENT("(GLclampf zNear = %f, GLclampf zFar = %f)", zNear, zFar);
 
@@ -1268,7 +1268,7 @@
     }
 }
 
-void __stdcall glDetachShader(GLuint program, GLuint shader)
+void GL_APIENTRY glDetachShader(GLuint program, GLuint shader)
 {
     EVENT("(GLuint program = %d, GLuint shader = %d)", program, shader);
 
@@ -1317,7 +1317,7 @@
     }
 }
 
-void __stdcall glDisable(GLenum cap)
+void GL_APIENTRY glDisable(GLenum cap)
 {
     EVENT("(GLenum cap = 0x%X)", cap);
 
@@ -1334,7 +1334,7 @@
     }
 }
 
-void __stdcall glDisableVertexAttribArray(GLuint index)
+void GL_APIENTRY glDisableVertexAttribArray(GLuint index)
 {
     EVENT("(GLuint index = %d)", index);
 
@@ -1351,7 +1351,7 @@
     }
 }
 
-void __stdcall glDrawArrays(GLenum mode, GLint first, GLsizei count)
+void GL_APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count)
 {
     EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d)", mode, first, count);
 
@@ -1372,7 +1372,7 @@
     }
 }
 
-void __stdcall glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+void GL_APIENTRY glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
 {
     EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d, GLsizei primcount = %d)", mode, first, count, primcount);
 
@@ -1393,7 +1393,7 @@
     }
 }
 
-void __stdcall glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
+void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
 {
     EVENT("(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const GLvoid* indices = 0x%0.8p)",
           mode, count, type, indices);
@@ -1416,7 +1416,7 @@
     }
 }
 
-void __stdcall glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
+void GL_APIENTRY glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
 {
     EVENT("(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const GLvoid* indices = 0x%0.8p, GLsizei primcount = %d)",
           mode, count, type, indices, primcount);
@@ -1439,7 +1439,7 @@
     }
 }
 
-void __stdcall glEnable(GLenum cap)
+void GL_APIENTRY glEnable(GLenum cap)
 {
     EVENT("(GLenum cap = 0x%X)", cap);
 
@@ -1456,7 +1456,7 @@
     }
 }
 
-void __stdcall glEnableVertexAttribArray(GLuint index)
+void GL_APIENTRY glEnableVertexAttribArray(GLuint index)
 {
     EVENT("(GLuint index = %d)", index);
 
@@ -1473,7 +1473,7 @@
     }
 }
 
-void __stdcall glEndQueryEXT(GLenum target)
+void GL_APIENTRY glEndQueryEXT(GLenum target)
 {
     EVENT("GLenum target = 0x%X)", target);
 
@@ -1494,7 +1494,7 @@
     }
 }
 
-void __stdcall glFinishFenceNV(GLuint fence)
+void GL_APIENTRY glFinishFenceNV(GLuint fence)
 {
     EVENT("(GLuint fence = %d)", fence);
 
@@ -1519,7 +1519,7 @@
     }
 }
 
-void __stdcall glFinish(void)
+void GL_APIENTRY glFinish(void)
 {
     EVENT("()");
 
@@ -1535,7 +1535,7 @@
     }
 }
 
-void __stdcall glFlush(void)
+void GL_APIENTRY glFlush(void)
 {
     EVENT("()");
 
@@ -1551,7 +1551,7 @@
     }
 }
 
-void __stdcall glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+void GL_APIENTRY glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 {
     EVENT("(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, "
           "GLuint renderbuffer = %d)", target, attachment, renderbuffertarget, renderbuffer);
@@ -1599,7 +1599,7 @@
     }
 }
 
-void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+void GL_APIENTRY glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
 {
     EVENT("(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, "
           "GLuint texture = %d, GLint level = %d)", target, attachment, textarget, texture, level);
@@ -1636,7 +1636,7 @@
     }
 }
 
-void __stdcall glFrontFace(GLenum mode)
+void GL_APIENTRY glFrontFace(GLenum mode)
 {
     EVENT("(GLenum mode = 0x%X)", mode);
 
@@ -1656,7 +1656,7 @@
     }
 }
 
-void __stdcall glGenBuffers(GLsizei n, GLuint* buffers)
+void GL_APIENTRY glGenBuffers(GLsizei n, GLuint* buffers)
 {
     EVENT("(GLsizei n = %d, GLuint* buffers = 0x%0.8p)", n, buffers);
 
@@ -1676,7 +1676,7 @@
     }
 }
 
-void __stdcall glGenerateMipmap(GLenum target)
+void GL_APIENTRY glGenerateMipmap(GLenum target)
 {
     EVENT("(GLenum target = 0x%X)", target);
 
@@ -1750,7 +1750,7 @@
     }
 }
 
-void __stdcall glGenFencesNV(GLsizei n, GLuint* fences)
+void GL_APIENTRY glGenFencesNV(GLsizei n, GLuint* fences)
 {
     EVENT("(GLsizei n = %d, GLuint* fences = 0x%0.8p)", n, fences);
 
@@ -1770,7 +1770,7 @@
     }
 }
 
-void __stdcall glGenFramebuffers(GLsizei n, GLuint* framebuffers)
+void GL_APIENTRY glGenFramebuffers(GLsizei n, GLuint* framebuffers)
 {
     EVENT("(GLsizei n = %d, GLuint* framebuffers = 0x%0.8p)", n, framebuffers);
 
@@ -1790,7 +1790,7 @@
     }
 }
 
-void __stdcall glGenQueriesEXT(GLsizei n, GLuint* ids)
+void GL_APIENTRY glGenQueriesEXT(GLsizei n, GLuint* ids)
 {
     EVENT("(GLsizei n = %d, GLuint* ids = 0x%0.8p)", n, ids);
 
@@ -1810,7 +1810,7 @@
     }
 }
 
-void __stdcall glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
+void GL_APIENTRY glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
 {
     EVENT("(GLsizei n = %d, GLuint* renderbuffers = 0x%0.8p)", n, renderbuffers);
 
@@ -1830,7 +1830,7 @@
     }
 }
 
-void __stdcall glGenTextures(GLsizei n, GLuint* textures)
+void GL_APIENTRY glGenTextures(GLsizei n, GLuint* textures)
 {
     EVENT("(GLsizei n = %d, GLuint* textures = 0x%0.8p)", n, textures);
 
@@ -1850,7 +1850,7 @@
     }
 }
 
-void __stdcall glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+void GL_APIENTRY glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
 {
     EVENT("(GLuint program = %d, GLuint index = %d, GLsizei bufsize = %d, GLsizei *length = 0x%0.8p, "
           "GLint *size = 0x%0.8p, GLenum *type = %0.8p, GLchar *name = %0.8p)",
@@ -1891,7 +1891,7 @@
     }
 }
 
-void __stdcall glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
+void GL_APIENTRY glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
 {
     EVENT("(GLuint program = %d, GLuint index = %d, GLsizei bufsize = %d, "
           "GLsizei* length = 0x%0.8p, GLint* size = 0x%0.8p, GLenum* type = 0x%0.8p, GLchar* name = 0x%0.8p)",
@@ -1933,7 +1933,7 @@
     }
 }
 
-void __stdcall glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
+void GL_APIENTRY glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
 {
     EVENT("(GLuint program = %d, GLsizei maxcount = %d, GLsizei* count = 0x%0.8p, GLuint* shaders = 0x%0.8p)",
           program, maxcount, count, shaders);
@@ -1967,7 +1967,7 @@
     }
 }
 
-GLint __stdcall glGetAttribLocation(GLuint program, const GLchar* name)
+GLint GL_APIENTRY glGetAttribLocation(GLuint program, const GLchar* name)
 {
     EVENT("(GLuint program = %d, const GLchar* name = %s)", program, name);
 
@@ -2003,7 +2003,7 @@
     return -1;
 }
 
-void __stdcall glGetBooleanv(GLenum pname, GLboolean* params)
+void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean* params)
 {
     EVENT("(GLenum pname = 0x%X, GLboolean* params = 0x%0.8p)",  pname, params);
 
@@ -2028,7 +2028,7 @@
     }
 }
 
-void __stdcall glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
+void GL_APIENTRY glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, params);
 
@@ -2081,7 +2081,7 @@
     }
 }
 
-GLenum __stdcall glGetError(void)
+GLenum GL_APIENTRY glGetError(void)
 {
     EVENT("()");
 
@@ -2095,7 +2095,7 @@
     return GL_NO_ERROR;
 }
 
-void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
+void GL_APIENTRY glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
 {
     EVENT("(GLuint fence = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", fence, pname, params);
 
@@ -2136,7 +2136,7 @@
     }
 }
 
-void __stdcall glGetFloatv(GLenum pname, GLfloat* params)
+void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat* params)
 {
     EVENT("(GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", pname, params);
 
@@ -2161,7 +2161,7 @@
     }
 }
 
-void __stdcall glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
+void GL_APIENTRY glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)",
           target, attachment, pname, params);
@@ -2458,7 +2458,7 @@
     }
 }
 
-GLenum __stdcall glGetGraphicsResetStatusEXT(void)
+GLenum GL_APIENTRY glGetGraphicsResetStatusEXT(void)
 {
     EVENT("()");
 
@@ -2472,7 +2472,7 @@
     return GL_NO_ERROR;
 }
 
-void __stdcall glGetIntegerv(GLenum pname, GLint* params)
+void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params)
 {
     EVENT("(GLenum pname = 0x%X, GLint* params = 0x%0.8p)", pname, params);
 
@@ -2498,7 +2498,7 @@
     }
 }
 
-void __stdcall glGetProgramiv(GLuint program, GLenum pname, GLint* params)
+void GL_APIENTRY glGetProgramiv(GLuint program, GLenum pname, GLint* params)
 {
     EVENT("(GLuint program = %d, GLenum pname = %d, GLint* params = 0x%0.8p)", program, pname, params);
 
@@ -2582,7 +2582,7 @@
     }
 }
 
-void __stdcall glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+void GL_APIENTRY glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
 {
     EVENT("(GLuint program = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* infolog = 0x%0.8p)",
           program, bufsize, length, infolog);
@@ -2608,7 +2608,7 @@
     }
 }
 
-void __stdcall glGetQueryivEXT(GLenum target, GLenum pname, GLint *params)
+void GL_APIENTRY glGetQueryivEXT(GLenum target, GLenum pname, GLint *params)
 {
     EVENT("GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", target, pname, params);
 
@@ -2634,7 +2634,7 @@
     }
 }
 
-void __stdcall glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params)
+void GL_APIENTRY glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params)
 {
     EVENT("(GLuint id = %d, GLenum pname = 0x%X, GLuint *params = 0x%0.8p)", id, pname, params);
 
@@ -2686,7 +2686,7 @@
     }
 }
 
-void __stdcall glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
+void GL_APIENTRY glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, params);
 
@@ -2735,7 +2735,7 @@
     }
 }
 
-void __stdcall glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
+void GL_APIENTRY glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
 {
     EVENT("(GLuint shader = %d, GLenum pname = %d, GLint* params = 0x%0.8p)", shader, pname, params);
 
@@ -2778,7 +2778,7 @@
     }
 }
 
-void __stdcall glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+void GL_APIENTRY glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
 {
     EVENT("(GLuint shader = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* infolog = 0x%0.8p)",
           shader, bufsize, length, infolog);
@@ -2804,7 +2804,7 @@
     }
 }
 
-void __stdcall glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
+void GL_APIENTRY glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
 {
     EVENT("(GLenum shadertype = 0x%X, GLenum precisiontype = 0x%X, GLint* range = 0x%0.8p, GLint* precision = 0x%0.8p)",
           shadertype, precisiontype, range, precision);
@@ -2851,7 +2851,7 @@
     }
 }
 
-void __stdcall glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
+void GL_APIENTRY glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
 {
     EVENT("(GLuint shader = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* source = 0x%0.8p)",
           shader, bufsize, length, source);
@@ -2877,7 +2877,7 @@
     }
 }
 
-void __stdcall glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
+void GL_APIENTRY glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
 {
     EVENT("(GLuint shader = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* source = 0x%0.8p)",
           shader, bufsize, length, source);
@@ -2903,7 +2903,7 @@
     }
 }
 
-const GLubyte* __stdcall glGetString(GLenum name)
+const GLubyte* GL_APIENTRY glGetString(GLenum name)
 {
     EVENT("(GLenum name = 0x%X)", name);
 
@@ -2949,7 +2949,7 @@
     }
 }
 
-void __stdcall glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
+void GL_APIENTRY glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", target, pname, params);
 
@@ -3081,7 +3081,7 @@
     }
 }
 
-void __stdcall glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
+void GL_APIENTRY glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, params);
 
@@ -3213,7 +3213,7 @@
     }
 }
 
-void __stdcall glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
+void GL_APIENTRY glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
 {
     EVENT("(GLuint program = %d, GLint location = %d, GLsizei bufSize = %d, GLfloat* params = 0x%0.8p)",
           program, location, bufSize, params);
@@ -3235,7 +3235,7 @@
     }
 }
 
-void __stdcall glGetUniformfv(GLuint program, GLint location, GLfloat* params)
+void GL_APIENTRY glGetUniformfv(GLuint program, GLint location, GLfloat* params)
 {
     EVENT("(GLuint program = %d, GLint location = %d, GLfloat* params = 0x%0.8p)", program, location, params);
 
@@ -3256,7 +3256,7 @@
     }
 }
 
-void __stdcall glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params)
+void GL_APIENTRY glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params)
 {
     EVENT("(GLuint program = %d, GLint location = %d, GLsizei bufSize = %d, GLint* params = 0x%0.8p)",
           program, location, bufSize, params);
@@ -3278,7 +3278,7 @@
     }
 }
 
-void __stdcall glGetUniformiv(GLuint program, GLint location, GLint* params)
+void GL_APIENTRY glGetUniformiv(GLuint program, GLint location, GLint* params)
 {
     EVENT("(GLuint program = %d, GLint location = %d, GLint* params = 0x%0.8p)", program, location, params);
 
@@ -3299,7 +3299,7 @@
     }
 }
 
-GLint __stdcall glGetUniformLocation(GLuint program, const GLchar* name)
+GLint GL_APIENTRY glGetUniformLocation(GLuint program, const GLchar* name)
 {
     EVENT("(GLuint program = %d, const GLchar* name = 0x%0.8p)", program, name);
 
@@ -3340,7 +3340,7 @@
     return -1;
 }
 
-void __stdcall glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
+void GL_APIENTRY glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
 {
     EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", index, pname, params);
 
@@ -3374,7 +3374,7 @@
     }
 }
 
-void __stdcall glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
+void GL_APIENTRY glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
 {
     EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", index, pname, params);
 
@@ -3410,7 +3410,7 @@
     }
 }
 
-void __stdcall glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
+void GL_APIENTRY glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
 {
     EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLvoid** pointer = 0x%0.8p)", index, pname, pointer);
 
@@ -3433,7 +3433,7 @@
     }
 }
 
-void __stdcall glHint(GLenum target, GLenum mode)
+void GL_APIENTRY glHint(GLenum target, GLenum mode)
 {
     EVENT("(GLenum target = 0x%X, GLenum mode = 0x%X)", target, mode);
 
@@ -3469,7 +3469,7 @@
     }
 }
 
-GLboolean __stdcall glIsBuffer(GLuint buffer)
+GLboolean GL_APIENTRY glIsBuffer(GLuint buffer)
 {
     EVENT("(GLuint buffer = %d)", buffer);
 
@@ -3487,7 +3487,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsEnabled(GLenum cap)
+GLboolean GL_APIENTRY glIsEnabled(GLenum cap)
 {
     EVENT("(GLenum cap = 0x%X)", cap);
 
@@ -3506,7 +3506,7 @@
     return false;
 }
 
-GLboolean __stdcall glIsFenceNV(GLuint fence)
+GLboolean GL_APIENTRY glIsFenceNV(GLuint fence)
 {
     EVENT("(GLuint fence = %d)", fence);
 
@@ -3526,7 +3526,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsFramebuffer(GLuint framebuffer)
+GLboolean GL_APIENTRY glIsFramebuffer(GLuint framebuffer)
 {
     EVENT("(GLuint framebuffer = %d)", framebuffer);
 
@@ -3544,7 +3544,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsProgram(GLuint program)
+GLboolean GL_APIENTRY glIsProgram(GLuint program)
 {
     EVENT("(GLuint program = %d)", program);
 
@@ -3562,7 +3562,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsQueryEXT(GLuint id)
+GLboolean GL_APIENTRY glIsQueryEXT(GLuint id)
 {
     EVENT("(GLuint id = %d)", id);
 
@@ -3575,7 +3575,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsRenderbuffer(GLuint renderbuffer)
+GLboolean GL_APIENTRY glIsRenderbuffer(GLuint renderbuffer)
 {
     EVENT("(GLuint renderbuffer = %d)", renderbuffer);
 
@@ -3593,7 +3593,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsShader(GLuint shader)
+GLboolean GL_APIENTRY glIsShader(GLuint shader)
 {
     EVENT("(GLuint shader = %d)", shader);
 
@@ -3611,7 +3611,7 @@
     return GL_FALSE;
 }
 
-GLboolean __stdcall glIsTexture(GLuint texture)
+GLboolean GL_APIENTRY glIsTexture(GLuint texture)
 {
     EVENT("(GLuint texture = %d)", texture);
 
@@ -3629,7 +3629,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glLineWidth(GLfloat width)
+void GL_APIENTRY glLineWidth(GLfloat width)
 {
     EVENT("(GLfloat width = %f)", width);
 
@@ -3646,7 +3646,7 @@
     }
 }
 
-void __stdcall glLinkProgram(GLuint program)
+void GL_APIENTRY glLinkProgram(GLuint program)
 {
     EVENT("(GLuint program = %d)", program);
 
@@ -3678,7 +3678,7 @@
     }
 }
 
-void __stdcall glPixelStorei(GLenum pname, GLint param)
+void GL_APIENTRY glPixelStorei(GLenum pname, GLint param)
 {
     EVENT("(GLenum pname = 0x%X, GLint param = %d)", pname, param);
 
@@ -3734,7 +3734,7 @@
     }
 }
 
-void __stdcall glPolygonOffset(GLfloat factor, GLfloat units)
+void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units)
 {
     EVENT("(GLfloat factor = %f, GLfloat units = %f)", factor, units);
 
@@ -3745,7 +3745,7 @@
     }
 }
 
-void __stdcall glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height,
+void GL_APIENTRY glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height,
                                 GLenum format, GLenum type, GLsizei bufSize,
                                 GLvoid *data)
 {
@@ -3777,7 +3777,7 @@
     }
 }
 
-void __stdcall glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+void GL_APIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
                             GLenum format, GLenum type, GLvoid* pixels)
 {
     EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, "
@@ -3808,7 +3808,7 @@
     }
 }
 
-void __stdcall glReleaseShaderCompiler(void)
+void GL_APIENTRY glReleaseShaderCompiler(void)
 {
     EVENT("()");
 
@@ -3820,7 +3820,7 @@
     }
 }
 
-void __stdcall glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+void GL_APIENTRY glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)",
           target, samples, internalformat, width, height);
@@ -3838,12 +3838,12 @@
     }
 }
 
-void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+void GL_APIENTRY glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
 {
     glRenderbufferStorageMultisampleANGLE(target, 0, internalformat, width, height);
 }
 
-void __stdcall glSampleCoverage(GLclampf value, GLboolean invert)
+void GL_APIENTRY glSampleCoverage(GLclampf value, GLboolean invert)
 {
     EVENT("(GLclampf value = %f, GLboolean invert = %u)", value, invert);
 
@@ -3855,7 +3855,7 @@
     }
 }
 
-void __stdcall glSetFenceNV(GLuint fence, GLenum condition)
+void GL_APIENTRY glSetFenceNV(GLuint fence, GLenum condition)
 {
     EVENT("(GLuint fence = %d, GLenum condition = 0x%X)", fence, condition);
 
@@ -3885,7 +3885,7 @@
     }
 }
 
-void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
+void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
 {
     EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)", x, y, width, height);
 
@@ -3902,7 +3902,7 @@
     }
 }
 
-void __stdcall glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
+void GL_APIENTRY glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
 {
     EVENT("(GLsizei n = %d, const GLuint* shaders = 0x%0.8p, GLenum binaryformat = 0x%X, "
           "const GLvoid* binary = 0x%0.8p, GLsizei length = %d)",
@@ -3923,7 +3923,7 @@
     }
 }
 
-void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length)
+void GL_APIENTRY glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length)
 {
     EVENT("(GLuint shader = %d, GLsizei count = %d, const GLchar** string = 0x%0.8p, const GLint* length = 0x%0.8p)",
           shader, count, string, length);
@@ -3957,12 +3957,12 @@
     }
 }
 
-void __stdcall glStencilFunc(GLenum func, GLint ref, GLuint mask)
+void GL_APIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask)
 {
     glStencilFuncSeparate(GL_FRONT_AND_BACK, func, ref, mask);
 }
 
-void __stdcall glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
+void GL_APIENTRY glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
 {
     EVENT("(GLenum face = 0x%X, GLenum func = 0x%X, GLint ref = %d, GLuint mask = %d)", face, func, ref, mask);
 
@@ -4010,12 +4010,12 @@
     }
 }
 
-void __stdcall glStencilMask(GLuint mask)
+void GL_APIENTRY glStencilMask(GLuint mask)
 {
     glStencilMaskSeparate(GL_FRONT_AND_BACK, mask);
 }
 
-void __stdcall glStencilMaskSeparate(GLenum face, GLuint mask)
+void GL_APIENTRY glStencilMaskSeparate(GLenum face, GLuint mask)
 {
     EVENT("(GLenum face = 0x%X, GLuint mask = %d)", face, mask);
 
@@ -4046,12 +4046,12 @@
     }
 }
 
-void __stdcall glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
 {
     glStencilOpSeparate(GL_FRONT_AND_BACK, fail, zfail, zpass);
 }
 
-void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
+void GL_APIENTRY glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
 {
     EVENT("(GLenum face = 0x%X, GLenum fail = 0x%X, GLenum zfail = 0x%X, GLenum zpas = 0x%Xs)",
           face, fail, zfail, zpass);
@@ -4134,7 +4134,7 @@
     }
 }
 
-GLboolean __stdcall glTestFenceNV(GLuint fence)
+GLboolean GL_APIENTRY glTestFenceNV(GLuint fence)
 {
     EVENT("(GLuint fence = %d)", fence);
 
@@ -4169,7 +4169,7 @@
     return GL_TRUE;
 }
 
-void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
                             GLint border, GLenum format, GLenum type, const GLvoid* pixels)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, GLsizei height = %d, "
@@ -4229,7 +4229,7 @@
     }
 }
 
-void __stdcall glTexParameterf(GLenum target, GLenum pname, GLfloat param)
+void GL_APIENTRY glTexParameterf(GLenum target, GLenum pname, GLfloat param)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint param = %f)", target, pname, param);
 
@@ -4273,12 +4273,12 @@
     }
 }
 
-void __stdcall glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
+void GL_APIENTRY glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
 {
     glTexParameterf(target, pname, (GLfloat)*params);
 }
 
-void __stdcall glTexParameteri(GLenum target, GLenum pname, GLint param)
+void GL_APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint param = %d)", target, pname, param);
 
@@ -4322,12 +4322,12 @@
     }
 }
 
-void __stdcall glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
+void GL_APIENTRY glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
 {
     glTexParameteri(target, pname, *params);
 }
 
-void __stdcall glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+void GL_APIENTRY glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)",
            target, levels, internalformat, width, height);
@@ -4376,7 +4376,7 @@
     }
 }
 
-void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
                                GLenum format, GLenum type, const GLvoid* pixels)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
@@ -4444,12 +4444,12 @@
     }
 }
 
-void __stdcall glUniform1f(GLint location, GLfloat x)
+void GL_APIENTRY glUniform1f(GLint location, GLfloat x)
 {
     glUniform1fv(location, 1, &x);
 }
 
-void __stdcall glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
+void GL_APIENTRY glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, v);
 
@@ -4466,12 +4466,12 @@
     }
 }
 
-void __stdcall glUniform1i(GLint location, GLint x)
+void GL_APIENTRY glUniform1i(GLint location, GLint x)
 {
     glUniform1iv(location, 1, &x);
 }
 
-void __stdcall glUniform1iv(GLint location, GLsizei count, const GLint* v)
+void GL_APIENTRY glUniform1iv(GLint location, GLsizei count, const GLint* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, v);
 
@@ -4488,14 +4488,14 @@
     }
 }
 
-void __stdcall glUniform2f(GLint location, GLfloat x, GLfloat y)
+void GL_APIENTRY glUniform2f(GLint location, GLfloat x, GLfloat y)
 {
     GLfloat xy[2] = {x, y};
 
     glUniform2fv(location, 1, xy);
 }
 
-void __stdcall glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
+void GL_APIENTRY glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, v);
 
@@ -4512,14 +4512,14 @@
     }
 }
 
-void __stdcall glUniform2i(GLint location, GLint x, GLint y)
+void GL_APIENTRY glUniform2i(GLint location, GLint x, GLint y)
 {
     GLint xy[2] = {x, y};
 
     glUniform2iv(location, 1, xy);
 }
 
-void __stdcall glUniform2iv(GLint location, GLsizei count, const GLint* v)
+void GL_APIENTRY glUniform2iv(GLint location, GLsizei count, const GLint* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, v);
 
@@ -4536,14 +4536,14 @@
     }
 }
 
-void __stdcall glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
+void GL_APIENTRY glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
 {
     GLfloat xyz[3] = {x, y, z};
 
     glUniform3fv(location, 1, xyz);
 }
 
-void __stdcall glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
+void GL_APIENTRY glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, v);
 
@@ -4560,14 +4560,14 @@
     }
 }
 
-void __stdcall glUniform3i(GLint location, GLint x, GLint y, GLint z)
+void GL_APIENTRY glUniform3i(GLint location, GLint x, GLint y, GLint z)
 {
     GLint xyz[3] = {x, y, z};
 
     glUniform3iv(location, 1, xyz);
 }
 
-void __stdcall glUniform3iv(GLint location, GLsizei count, const GLint* v)
+void GL_APIENTRY glUniform3iv(GLint location, GLsizei count, const GLint* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, v);
 
@@ -4584,14 +4584,14 @@
     }
 }
 
-void __stdcall glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+void GL_APIENTRY glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
     GLfloat xyzw[4] = {x, y, z, w};
 
     glUniform4fv(location, 1, xyzw);
 }
 
-void __stdcall glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
+void GL_APIENTRY glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, v);
 
@@ -4608,14 +4608,14 @@
     }
 }
 
-void __stdcall glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
+void GL_APIENTRY glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
 {
     GLint xyzw[4] = {x, y, z, w};
 
     glUniform4iv(location, 1, xyzw);
 }
 
-void __stdcall glUniform4iv(GLint location, GLsizei count, const GLint* v)
+void GL_APIENTRY glUniform4iv(GLint location, GLsizei count, const GLint* v)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, v);
 
@@ -4632,7 +4632,7 @@
     }
 }
 
-void __stdcall glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -4650,7 +4650,7 @@
     }
 }
 
-void __stdcall glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -4668,7 +4668,7 @@
     }
 }
 
-void __stdcall glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -4686,7 +4686,7 @@
     }
 }
 
-void __stdcall glUseProgram(GLuint program)
+void GL_APIENTRY glUseProgram(GLuint program)
 {
     EVENT("(GLuint program = %d)", program);
 
@@ -4719,7 +4719,7 @@
     }
 }
 
-void __stdcall glValidateProgram(GLuint program)
+void GL_APIENTRY glValidateProgram(GLuint program)
 {
     EVENT("(GLuint program = %d)", program);
 
@@ -4746,7 +4746,7 @@
     }
 }
 
-void __stdcall glVertexAttrib1f(GLuint index, GLfloat x)
+void GL_APIENTRY glVertexAttrib1f(GLuint index, GLfloat x)
 {
     EVENT("(GLuint index = %d, GLfloat x = %f)", index, x);
 
@@ -4764,7 +4764,7 @@
     }
 }
 
-void __stdcall glVertexAttrib1fv(GLuint index, const GLfloat* values)
+void GL_APIENTRY glVertexAttrib1fv(GLuint index, const GLfloat* values)
 {
     EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values);
 
@@ -4782,7 +4782,7 @@
     }
 }
 
-void __stdcall glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
+void GL_APIENTRY glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
 {
     EVENT("(GLuint index = %d, GLfloat x = %f, GLfloat y = %f)", index, x, y);
 
@@ -4800,7 +4800,7 @@
     }
 }
 
-void __stdcall glVertexAttrib2fv(GLuint index, const GLfloat* values)
+void GL_APIENTRY glVertexAttrib2fv(GLuint index, const GLfloat* values)
 {
     EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values);
 
@@ -4818,7 +4818,7 @@
     }
 }
 
-void __stdcall glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+void GL_APIENTRY glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
 {
     EVENT("(GLuint index = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", index, x, y, z);
 
@@ -4836,7 +4836,7 @@
     }
 }
 
-void __stdcall glVertexAttrib3fv(GLuint index, const GLfloat* values)
+void GL_APIENTRY glVertexAttrib3fv(GLuint index, const GLfloat* values)
 {
     EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values);
 
@@ -4854,7 +4854,7 @@
     }
 }
 
-void __stdcall glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+void GL_APIENTRY glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
     EVENT("(GLuint index = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat w = %f)", index, x, y, z, w);
 
@@ -4872,7 +4872,7 @@
     }
 }
 
-void __stdcall glVertexAttrib4fv(GLuint index, const GLfloat* values)
+void GL_APIENTRY glVertexAttrib4fv(GLuint index, const GLfloat* values)
 {
     EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values);
 
@@ -4889,7 +4889,7 @@
     }
 }
 
-void __stdcall glVertexAttribDivisorANGLE(GLuint index, GLuint divisor)
+void GL_APIENTRY glVertexAttribDivisorANGLE(GLuint index, GLuint divisor)
 {
     EVENT("(GLuint index = %d, GLuint divisor = %d)", index, divisor);
 
@@ -4906,7 +4906,7 @@
     }
 }
 
-void __stdcall glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
+void GL_APIENTRY glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
 {
     EVENT("(GLuint index = %d, GLint size = %d, GLenum type = 0x%X, "
           "GLboolean normalized = %u, GLsizei stride = %d, const GLvoid* ptr = 0x%0.8p)",
@@ -4981,7 +4981,7 @@
     }
 }
 
-void __stdcall glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
+void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
 {
     EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)", x, y, width, height);
 
@@ -5000,7 +5000,7 @@
 
 // OpenGL ES 3.0 functions
 
-void __stdcall glReadBuffer(GLenum mode)
+void GL_APIENTRY glReadBuffer(GLenum mode)
 {
     EVENT("(GLenum mode = 0x%X)", mode);
 
@@ -5018,7 +5018,7 @@
     }
 }
 
-void __stdcall glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
+void GL_APIENTRY glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
 {
     EVENT("(GLenum mode = 0x%X, GLuint start = %u, GLuint end = %u, GLsizei count = %d, GLenum type = 0x%X, "
           "const GLvoid* indices = 0x%0.8p)", mode, start, end, count, type, indices);
@@ -5037,7 +5037,7 @@
     }
 }
 
-void __stdcall glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+void GL_APIENTRY glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
           "GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, "
@@ -5093,7 +5093,7 @@
     }
 }
 
-void __stdcall glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+void GL_APIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
           "GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
@@ -5156,7 +5156,7 @@
     }
 }
 
-void __stdcall glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+void GL_APIENTRY glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
           "GLint zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
@@ -5198,7 +5198,7 @@
     }
 }
 
-void __stdcall glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+void GL_APIENTRY glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = %d, "
           "GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
@@ -5261,7 +5261,7 @@
     }
 }
 
-void __stdcall glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+void GL_APIENTRY glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
         "GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
@@ -5338,7 +5338,7 @@
     }
 }
 
-void __stdcall glGenQueries(GLsizei n, GLuint* ids)
+void GL_APIENTRY glGenQueries(GLsizei n, GLuint* ids)
 {
     EVENT("(GLsizei n = %d, GLuint* ids = 0x%0.8p)", n, ids);
 
@@ -5364,7 +5364,7 @@
     }
 }
 
-void __stdcall glDeleteQueries(GLsizei n, const GLuint* ids)
+void GL_APIENTRY glDeleteQueries(GLsizei n, const GLuint* ids)
 {
     EVENT("(GLsizei n = %d, GLuint* ids = 0x%0.8p)", n, ids);
 
@@ -5390,7 +5390,7 @@
     }
 }
 
-GLboolean __stdcall glIsQuery(GLuint id)
+GLboolean GL_APIENTRY glIsQuery(GLuint id)
 {
     EVENT("(GLuint id = %u)", id);
 
@@ -5409,7 +5409,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glBeginQuery(GLenum target, GLuint id)
+void GL_APIENTRY glBeginQuery(GLenum target, GLuint id)
 {
     EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);
 
@@ -5436,7 +5436,7 @@
     }
 }
 
-void __stdcall glEndQuery(GLenum target)
+void GL_APIENTRY glEndQuery(GLenum target)
 {
     EVENT("(GLenum target = 0x%X)", target);
 
@@ -5463,7 +5463,7 @@
     }
 }
 
-void __stdcall glGetQueryiv(GLenum target, GLenum pname, GLint* params)
+void GL_APIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, params);
 
@@ -5495,7 +5495,7 @@
     }
 }
 
-void __stdcall glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
+void GL_APIENTRY glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
 {
     EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", id, pname, params);
 
@@ -5553,7 +5553,7 @@
     }
 }
 
-GLboolean __stdcall glUnmapBuffer(GLenum target)
+GLboolean GL_APIENTRY glUnmapBuffer(GLenum target)
 {
     EVENT("(GLenum target = 0x%X)", target);
 
@@ -5572,7 +5572,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
+void GL_APIENTRY glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLvoid** params = 0x%0.8p)", target, pname, params);
 
@@ -5589,7 +5589,7 @@
     }
 }
 
-void __stdcall glDrawBuffers(GLsizei n, const GLenum* bufs)
+void GL_APIENTRY glDrawBuffers(GLsizei n, const GLenum* bufs)
 {
     gl::Context *context = gl::getNonLostContext();
     if (context)
@@ -5604,7 +5604,7 @@
     }
 }
 
-void __stdcall glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -5622,7 +5622,7 @@
     }
 }
 
-void __stdcall glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -5640,7 +5640,7 @@
     }
 }
 
-void __stdcall glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -5658,7 +5658,7 @@
     }
 }
 
-void __stdcall glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -5676,7 +5676,7 @@
     }
 }
 
-void __stdcall glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -5694,7 +5694,7 @@
     }
 }
 
-void __stdcall glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+void GL_APIENTRY glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value = 0x%0.8p)",
           location, count, transpose, value);
@@ -5712,7 +5712,7 @@
     }
 }
 
-void __stdcall glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+void GL_APIENTRY glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
 {
     EVENT("(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, GLint dstX0 = %d, "
           "GLint dstY0 = %d, GLint dstX1 = %d, GLint dstY1 = %d, GLbitfield mask = 0x%X, GLenum filter = 0x%X)",
@@ -5744,7 +5744,7 @@
     }
 }
 
-void __stdcall glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+void GL_APIENTRY glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)",
         target, samples, internalformat, width, height);
@@ -5768,7 +5768,7 @@
     }
 }
 
-void __stdcall glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+void GL_APIENTRY glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
 {
     EVENT("(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d, GLint layer = %d)",
         target, attachment, texture, level, layer);
@@ -5805,7 +5805,7 @@
     }
 }
 
-GLvoid* __stdcall glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+GLvoid* GL_APIENTRY glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
 {
     EVENT("(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr length = %d, GLbitfield access = 0x%X)",
           target, offset, length, access);
@@ -5825,7 +5825,7 @@
     return NULL;
 }
 
-void __stdcall glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+void GL_APIENTRY glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
 {
     EVENT("(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr length = %d)", target, offset, length);
 
@@ -5842,7 +5842,7 @@
     }
 }
 
-void __stdcall glBindVertexArray(GLuint array)
+void GL_APIENTRY glBindVertexArray(GLuint array)
 {
     EVENT("(GLuint array = %u)", array);
 
@@ -5869,7 +5869,7 @@
     }
 }
 
-void __stdcall glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
+void GL_APIENTRY glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
 {
     EVENT("(GLsizei n = %d, const GLuint* arrays = 0x%0.8p)", n, arrays);
 
@@ -5898,7 +5898,7 @@
     }
 }
 
-void __stdcall glGenVertexArrays(GLsizei n, GLuint* arrays)
+void GL_APIENTRY glGenVertexArrays(GLsizei n, GLuint* arrays)
 {
     EVENT("(GLsizei n = %d, GLuint* arrays = 0x%0.8p)", n, arrays);
 
@@ -5924,7 +5924,7 @@
     }
 }
 
-GLboolean __stdcall glIsVertexArray(GLuint array)
+GLboolean GL_APIENTRY glIsVertexArray(GLuint array)
 {
     EVENT("(GLuint array = %u)", array);
 
@@ -5950,7 +5950,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
+void GL_APIENTRY glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
 {
     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLint* data = 0x%0.8p)",
           target, index, data);
@@ -6031,7 +6031,7 @@
     }
 }
 
-void __stdcall glBeginTransformFeedback(GLenum primitiveMode)
+void GL_APIENTRY glBeginTransformFeedback(GLenum primitiveMode)
 {
     EVENT("(GLenum primitiveMode = 0x%X)", primitiveMode);
 
@@ -6076,7 +6076,7 @@
     }
 }
 
-void __stdcall glEndTransformFeedback(void)
+void GL_APIENTRY glEndTransformFeedback(void)
 {
     EVENT("(void)");
 
@@ -6102,7 +6102,7 @@
     }
 }
 
-void __stdcall glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+void GL_APIENTRY glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
 {
     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLuint buffer = %u, GLintptr offset = %d, GLsizeiptr size = %d)",
           target, index, buffer, offset, size);
@@ -6180,7 +6180,7 @@
     }
 }
 
-void __stdcall glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+void GL_APIENTRY glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
 {
     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLuint buffer = %u)",
           target, index, buffer);
@@ -6236,7 +6236,7 @@
     }
 }
 
-void __stdcall glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
+void GL_APIENTRY glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
 {
     EVENT("(GLuint program = %u, GLsizei count = %d, const GLchar* const* varyings = 0x%0.8p, GLenum bufferMode = 0x%X)",
           program, count, varyings, bufferMode);
@@ -6285,7 +6285,7 @@
     }
 }
 
-void __stdcall glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
+void GL_APIENTRY glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
 {
     EVENT("(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei* length = 0x%0.8p, "
           "GLsizei* size = 0x%0.8p, GLenum* type = 0x%0.8p, GLchar* name = 0x%0.8p)",
@@ -6324,7 +6324,7 @@
     }
 }
 
-void __stdcall glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+void GL_APIENTRY glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
 {
     EVENT("(GLuint index = %u, GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const GLvoid* pointer = 0x%0.8p)",
           index, size, type, stride, pointer);
@@ -6394,7 +6394,7 @@
     }
 }
 
-void __stdcall glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+void GL_APIENTRY glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
 {
     EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLint* params = 0x%0.8p)",
           index, pname, params);
@@ -6436,7 +6436,7 @@
     }
 }
 
-void __stdcall glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+void GL_APIENTRY glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
 {
     EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLuint* params = 0x%0.8p)",
           index, pname, params);
@@ -6478,7 +6478,7 @@
     }
 }
 
-void __stdcall glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
+void GL_APIENTRY glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
 {
     EVENT("(GLuint index = %u, GLint x = %d, GLint y = %d, GLint z = %d, GLint w = %d)",
           index, x, y, z, w);
@@ -6503,7 +6503,7 @@
     }
 }
 
-void __stdcall glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+void GL_APIENTRY glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
 {
     EVENT("(GLuint index = %u, GLuint x = %u, GLuint y = %u, GLuint z = %u, GLuint w = %u)",
           index, x, y, z, w);
@@ -6528,7 +6528,7 @@
     }
 }
 
-void __stdcall glVertexAttribI4iv(GLuint index, const GLint* v)
+void GL_APIENTRY glVertexAttribI4iv(GLuint index, const GLint* v)
 {
     EVENT("(GLuint index = %u, const GLint* v = 0x%0.8p)", index, v);
 
@@ -6551,7 +6551,7 @@
     }
 }
 
-void __stdcall glVertexAttribI4uiv(GLuint index, const GLuint* v)
+void GL_APIENTRY glVertexAttribI4uiv(GLuint index, const GLuint* v)
 {
     EVENT("(GLuint index = %u, const GLuint* v = 0x%0.8p)", index, v);
 
@@ -6574,7 +6574,7 @@
     }
 }
 
-void __stdcall glGetUniformuiv(GLuint program, GLint location, GLuint* params)
+void GL_APIENTRY glGetUniformuiv(GLuint program, GLint location, GLuint* params)
 {
     EVENT("(GLuint program = %u, GLint location = %d, GLuint* params = 0x%0.8p)",
           program, location, params);
@@ -6596,7 +6596,7 @@
     }
 }
 
-GLint __stdcall glGetFragDataLocation(GLuint program, const GLchar *name)
+GLint GL_APIENTRY glGetFragDataLocation(GLuint program, const GLchar *name)
 {
     EVENT("(GLuint program = %u, const GLchar *name = 0x%0.8p)",
           program, name);
@@ -6637,30 +6637,30 @@
     return 0;
 }
 
-void __stdcall glUniform1ui(GLint location, GLuint v0)
+void GL_APIENTRY glUniform1ui(GLint location, GLuint v0)
 {
     glUniform1uiv(location, 1, &v0);
 }
 
-void __stdcall glUniform2ui(GLint location, GLuint v0, GLuint v1)
+void GL_APIENTRY glUniform2ui(GLint location, GLuint v0, GLuint v1)
 {
     const GLuint xy[] = { v0, v1 };
     glUniform2uiv(location, 1, xy);
 }
 
-void __stdcall glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+void GL_APIENTRY glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
 {
     const GLuint xyz[] = { v0, v1, v2 };
     glUniform3uiv(location, 1, xyz);
 }
 
-void __stdcall glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+void GL_APIENTRY glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
 {
     const GLuint xyzw[] = { v0, v1, v2, v3 };
     glUniform4uiv(location, 1, xyzw);
 }
 
-void __stdcall glUniform1uiv(GLint location, GLsizei count, const GLuint* value)
+void GL_APIENTRY glUniform1uiv(GLint location, GLsizei count, const GLuint* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint* value = 0x%0.8p)",
           location, count, value);
@@ -6678,7 +6678,7 @@
     }
 }
 
-void __stdcall glUniform2uiv(GLint location, GLsizei count, const GLuint* value)
+void GL_APIENTRY glUniform2uiv(GLint location, GLsizei count, const GLuint* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint* value = 0x%0.8p)",
           location, count, value);
@@ -6696,7 +6696,7 @@
     }
 }
 
-void __stdcall glUniform3uiv(GLint location, GLsizei count, const GLuint* value)
+void GL_APIENTRY glUniform3uiv(GLint location, GLsizei count, const GLuint* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint* value)",
           location, count, value);
@@ -6714,7 +6714,7 @@
     }
 }
 
-void __stdcall glUniform4uiv(GLint location, GLsizei count, const GLuint* value)
+void GL_APIENTRY glUniform4uiv(GLint location, GLsizei count, const GLuint* value)
 {
     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint* value = 0x%0.8p)",
           location, count, value);
@@ -6732,7 +6732,7 @@
     }
 }
 
-void __stdcall glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
+void GL_APIENTRY glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
 {
     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLint* value = 0x%0.8p)",
           buffer, drawbuffer, value);
@@ -6777,7 +6777,7 @@
     }
 }
 
-void __stdcall glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
+void GL_APIENTRY glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
 {
     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLuint* value = 0x%0.8p)",
           buffer, drawbuffer, value);
@@ -6814,7 +6814,7 @@
     }
 }
 
-void __stdcall glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
+void GL_APIENTRY glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
 {
     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLfloat* value = 0x%0.8p)",
           buffer, drawbuffer, value);
@@ -6859,7 +6859,7 @@
     }
 }
 
-void __stdcall glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+void GL_APIENTRY glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
 {
     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, GLfloat depth, GLint stencil = %d)",
           buffer, drawbuffer, depth, stencil);
@@ -6896,7 +6896,7 @@
     }
 }
 
-const GLubyte* __stdcall glGetStringi(GLenum name, GLuint index)
+const GLubyte* GL_APIENTRY glGetStringi(GLenum name, GLuint index)
 {
     EVENT("(GLenum name = 0x%X, GLuint index = %u)", name, index);
 
@@ -6927,7 +6927,7 @@
     return NULL;
 }
 
-void __stdcall glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+void GL_APIENTRY glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
 {
     EVENT("(GLenum readTarget = 0x%X, GLenum writeTarget = 0x%X, GLintptr readOffset = %d, GLintptr writeOffset = %d, GLsizeiptr size = %d)",
           readTarget, writeTarget, readOffset, writeOffset, size);
@@ -6971,7 +6971,7 @@
             return;
         }
 
-        if (readBuffer == writeBuffer && abs(readOffset - writeOffset) < size)
+        if (readBuffer == writeBuffer && std::abs(readOffset - writeOffset) < size)
         {
             context->recordError(gl::Error(GL_INVALID_VALUE));
             return;
@@ -6990,7 +6990,7 @@
     }
 }
 
-void __stdcall glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
+void GL_APIENTRY glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
 {
     EVENT("(GLuint program = %u, GLsizei uniformCount = %d, const GLchar* const* uniformNames = 0x%0.8p, GLuint* uniformIndices = 0x%0.8p)",
           program, uniformCount, uniformNames, uniformIndices);
@@ -7044,7 +7044,7 @@
     }
 }
 
-void __stdcall glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
+void GL_APIENTRY glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
 {
     EVENT("(GLuint program = %u, GLsizei uniformCount = %d, const GLuint* uniformIndices = 0x%0.8p, GLenum pname = 0x%X, GLint* params = 0x%0.8p)",
           program, uniformCount, uniformIndices, pname, params);
@@ -7124,7 +7124,7 @@
     }
 }
 
-GLuint __stdcall glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
+GLuint GL_APIENTRY glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
 {
     EVENT("(GLuint program = %u, const GLchar* uniformBlockName = 0x%0.8p)", program, uniformBlockName);
 
@@ -7165,7 +7165,7 @@
     return 0;
 }
 
-void __stdcall glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+void GL_APIENTRY glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
 {
     EVENT("(GLuint program = %u, GLuint uniformBlockIndex = %u, GLenum pname = 0x%X, GLint* params = 0x%0.8p)",
           program, uniformBlockIndex, pname, params);
@@ -7224,7 +7224,7 @@
     }
 }
 
-void __stdcall glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+void GL_APIENTRY glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
 {
     EVENT("(GLuint program = %u, GLuint uniformBlockIndex = %u, GLsizei bufSize = %d, GLsizei* length = 0x%0.8p, GLchar* uniformBlockName = 0x%0.8p)",
           program, uniformBlockIndex, bufSize, length, uniformBlockName);
@@ -7266,7 +7266,7 @@
     }
 }
 
-void __stdcall glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+void GL_APIENTRY glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
 {
     EVENT("(GLuint program = %u, GLuint uniformBlockIndex = %u, GLuint uniformBlockBinding = %u)",
           program, uniformBlockIndex, uniformBlockBinding);
@@ -7315,7 +7315,7 @@
     }
 }
 
-void __stdcall glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
+void GL_APIENTRY glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
 {
     EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d, GLsizei instanceCount = %d)",
           mode, first, count, instanceCount);
@@ -7334,7 +7334,7 @@
     }
 }
 
-void __stdcall glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
+void GL_APIENTRY glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
 {
     EVENT("(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const GLvoid* indices = 0x%0.8p, GLsizei instanceCount = %d)",
           mode, count, type, indices, instanceCount);
@@ -7353,7 +7353,7 @@
     }
 }
 
-GLsync __stdcall glFenceSync(GLenum condition, GLbitfield flags)
+GLsync GL_APIENTRY glFenceSync(GLenum condition, GLbitfield flags)
 {
     EVENT("(GLenum condition = 0x%X, GLbitfield flags = 0x%X)", condition, flags);
 
@@ -7395,7 +7395,7 @@
     return NULL;
 }
 
-GLboolean __stdcall glIsSync(GLsync sync)
+GLboolean GL_APIENTRY glIsSync(GLsync sync)
 {
     EVENT("(GLsync sync = 0x%0.8p)", sync);
 
@@ -7414,7 +7414,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glDeleteSync(GLsync sync)
+void GL_APIENTRY glDeleteSync(GLsync sync)
 {
     EVENT("(GLsync sync = 0x%0.8p)", sync);
 
@@ -7437,7 +7437,7 @@
     }
 }
 
-GLenum __stdcall glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+GLenum GL_APIENTRY glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
 {
     EVENT("(GLsync sync = 0x%0.8p, GLbitfield flags = 0x%X, GLuint64 timeout = %llu)",
           sync, flags, timeout);
@@ -7479,7 +7479,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+void GL_APIENTRY glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
 {
     EVENT("(GLsync sync = 0x%0.8p, GLbitfield flags = 0x%X, GLuint64 timeout = %llu)",
           sync, flags, timeout);
@@ -7521,7 +7521,7 @@
     }
 }
 
-void __stdcall glGetInteger64v(GLenum pname, GLint64* params)
+void GL_APIENTRY glGetInteger64v(GLenum pname, GLint64* params)
 {
     EVENT("(GLenum pname = 0x%X, GLint64* params = 0x%0.8p)",
           pname, params);
@@ -7553,7 +7553,7 @@
     }
 }
 
-void __stdcall glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+void GL_APIENTRY glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
 {
     EVENT("(GLsync sync = 0x%0.8p, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei* length = 0x%0.8p, GLint* values = 0x%0.8p)",
           sync, pname, bufSize, length, values);
@@ -7605,7 +7605,7 @@
     }
 }
 
-void __stdcall glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+void GL_APIENTRY glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
 {
     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLint64* data = 0x%0.8p)",
           target, index, data);
@@ -7681,7 +7681,7 @@
     }
 }
 
-void __stdcall glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
+void GL_APIENTRY glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint64* params = 0x%0.8p)",
           target, pname, params);
@@ -7741,7 +7741,7 @@
     }
 }
 
-void __stdcall glGenSamplers(GLsizei count, GLuint* samplers)
+void GL_APIENTRY glGenSamplers(GLsizei count, GLuint* samplers)
 {
     EVENT("(GLsizei count = %d, GLuint* samplers = 0x%0.8p)", count, samplers);
 
@@ -7767,7 +7767,7 @@
     }
 }
 
-void __stdcall glDeleteSamplers(GLsizei count, const GLuint* samplers)
+void GL_APIENTRY glDeleteSamplers(GLsizei count, const GLuint* samplers)
 {
     EVENT("(GLsizei count = %d, const GLuint* samplers = 0x%0.8p)", count, samplers);
 
@@ -7793,7 +7793,7 @@
     }
 }
 
-GLboolean __stdcall glIsSampler(GLuint sampler)
+GLboolean GL_APIENTRY glIsSampler(GLuint sampler)
 {
     EVENT("(GLuint sampler = %u)", sampler);
 
@@ -7812,7 +7812,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glBindSampler(GLuint unit, GLuint sampler)
+void GL_APIENTRY glBindSampler(GLuint unit, GLuint sampler)
 {
     EVENT("(GLuint unit = %u, GLuint sampler = %u)", unit, sampler);
 
@@ -7841,7 +7841,7 @@
     }
 }
 
-void __stdcall glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+void GL_APIENTRY glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
 {
     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint param = %d)", sampler, pname, param);
 
@@ -7874,12 +7874,12 @@
     }
 }
 
-void __stdcall glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
+void GL_APIENTRY glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
 {
     glSamplerParameteri(sampler, pname, *param);
 }
 
-void __stdcall glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+void GL_APIENTRY glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
 {
     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLfloat param = %g)", sampler, pname, param);
 
@@ -7912,12 +7912,12 @@
     }
 }
 
-void __stdcall glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
+void GL_APIENTRY glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
 {
     glSamplerParameterf(sampler, pname, *param);
 }
 
-void __stdcall glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+void GL_APIENTRY glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
 {
     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", sampler, pname, params);
 
@@ -7945,7 +7945,7 @@
     }
 }
 
-void __stdcall glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+void GL_APIENTRY glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
 {
     EVENT("(GLuint sample = %ur, GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", sampler, pname, params);
 
@@ -7973,7 +7973,7 @@
     }
 }
 
-void __stdcall glVertexAttribDivisor(GLuint index, GLuint divisor)
+void GL_APIENTRY glVertexAttribDivisor(GLuint index, GLuint divisor)
 {
     EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);
 
@@ -7996,7 +7996,7 @@
     }
 }
 
-void __stdcall glBindTransformFeedback(GLenum target, GLuint id)
+void GL_APIENTRY glBindTransformFeedback(GLenum target, GLuint id)
 {
     EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);
 
@@ -8039,7 +8039,7 @@
     }
 }
 
-void __stdcall glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
+void GL_APIENTRY glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
 {
     EVENT("(GLsizei n = %d, const GLuint* ids = 0x%0.8p)", n, ids);
 
@@ -8059,7 +8059,7 @@
     }
 }
 
-void __stdcall glGenTransformFeedbacks(GLsizei n, GLuint* ids)
+void GL_APIENTRY glGenTransformFeedbacks(GLsizei n, GLuint* ids)
 {
     EVENT("(GLsizei n = %d, GLuint* ids = 0x%0.8p)", n, ids);
 
@@ -8079,7 +8079,7 @@
     }
 }
 
-GLboolean __stdcall glIsTransformFeedback(GLuint id)
+GLboolean GL_APIENTRY glIsTransformFeedback(GLuint id)
 {
     EVENT("(GLuint id = %u)", id);
 
@@ -8098,7 +8098,7 @@
     return GL_FALSE;
 }
 
-void __stdcall glPauseTransformFeedback(void)
+void GL_APIENTRY glPauseTransformFeedback(void)
 {
     EVENT("(void)");
 
@@ -8125,7 +8125,7 @@
     }
 }
 
-void __stdcall glResumeTransformFeedback(void)
+void GL_APIENTRY glResumeTransformFeedback(void)
 {
     EVENT("(void)");
 
@@ -8152,7 +8152,7 @@
     }
 }
 
-void __stdcall glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
+void GL_APIENTRY glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
 {
     EVENT("(GLuint program = %u, GLsizei bufSize = %d, GLsizei* length = 0x%0.8p, GLenum* binaryFormat = 0x%0.8p, GLvoid* binary = 0x%0.8p)",
           program, bufSize, length, binaryFormat, binary);
@@ -8171,7 +8171,7 @@
     }
 }
 
-void __stdcall glProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
+void GL_APIENTRY glProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
 {
     EVENT("(GLuint program = %u, GLenum binaryFormat = 0x%X, const GLvoid* binary = 0x%0.8p, GLsizei length = %d)",
           program, binaryFormat, binary, length);
@@ -8190,7 +8190,7 @@
     }
 }
 
-void __stdcall glProgramParameteri(GLuint program, GLenum pname, GLint value)
+void GL_APIENTRY glProgramParameteri(GLuint program, GLenum pname, GLint value)
 {
     EVENT("(GLuint program = %u, GLenum pname = 0x%X, GLint value = %d)",
           program, pname, value);
@@ -8209,7 +8209,7 @@
     }
 }
 
-void __stdcall glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+void GL_APIENTRY glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
 {
     EVENT("(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum* attachments = 0x%0.8p)",
           target, numAttachments, attachments);
@@ -8236,7 +8236,7 @@
     }
 }
 
-void __stdcall glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+void GL_APIENTRY glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum* attachments = 0x%0.8p, GLint x = %d, "
           "GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
@@ -8264,7 +8264,7 @@
     }
 }
 
-void __stdcall glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
 {
     EVENT("(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)",
           target, levels, internalformat, width, height);
@@ -8306,7 +8306,7 @@
     }
 }
 
-void __stdcall glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
 {
     EVENT("(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = %d, "
           "GLsizei height = %d, GLsizei depth = %d)",
@@ -8348,7 +8348,7 @@
     }
 }
 
-void __stdcall glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+void GL_APIENTRY glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
 {
     EVENT("(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, "
           "GLint* params = 0x%0.8p)",
@@ -8404,7 +8404,7 @@
 
 // Extension functions
 
-void __stdcall glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+void GL_APIENTRY glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
                                       GLbitfield mask, GLenum filter)
 {
     EVENT("(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, "
@@ -8432,7 +8432,7 @@
     }
 }
 
-void __stdcall glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth,
+void GL_APIENTRY glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth,
                                GLint border, GLenum format, GLenum type, const GLvoid* pixels)
 {
     EVENT("(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, "
@@ -8443,7 +8443,7 @@
     UNIMPLEMENTED();   // FIXME
 }
 
-void __stdcall glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length,
+void GL_APIENTRY glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length,
                                      GLenum *binaryFormat, void *binary)
 {
     EVENT("(GLenum program = 0x%X, bufSize = %d, length = 0x%0.8p, binaryFormat = 0x%0.8p, binary = 0x%0.8p)",
@@ -8477,7 +8477,7 @@
     }
 }
 
-void __stdcall glProgramBinaryOES(GLuint program, GLenum binaryFormat,
+void GL_APIENTRY glProgramBinaryOES(GLuint program, GLenum binaryFormat,
                                   const void *binary, GLint length)
 {
     EVENT("(GLenum program = 0x%X, binaryFormat = 0x%x, binary = 0x%0.8p, length = %d)",
@@ -8509,7 +8509,7 @@
     }
 }
 
-void __stdcall glDrawBuffersEXT(GLsizei n, const GLenum *bufs)
+void GL_APIENTRY glDrawBuffersEXT(GLsizei n, const GLenum *bufs)
 {
     EVENT("(GLenum n = %d, bufs = 0x%0.8p)", n, bufs);
 
@@ -8563,7 +8563,7 @@
     }
 }
 
-void __stdcall glGetBufferPointervOES(GLenum target, GLenum pname, void** params)
+void GL_APIENTRY glGetBufferPointervOES(GLenum target, GLenum pname, void** params)
 {
     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLvoid** params = 0x%0.8p)", target, pname, params);
 
@@ -8595,7 +8595,7 @@
     }
 }
 
-void * __stdcall glMapBufferOES(GLenum target, GLenum access)
+void * GL_APIENTRY glMapBufferOES(GLenum target, GLenum access)
 {
     EVENT("(GLenum target = 0x%X, GLbitfield access = 0x%X)", target, access);
 
@@ -8641,7 +8641,7 @@
     return NULL;
 }
 
-GLboolean __stdcall glUnmapBufferOES(GLenum target)
+GLboolean GL_APIENTRY glUnmapBufferOES(GLenum target)
 {
     EVENT("(GLenum target = 0x%X)", target);
 
@@ -8677,7 +8677,7 @@
     return GL_FALSE;
 }
 
-void* __stdcall glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+void* GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
 {
     EVENT("(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr length = %d, GLbitfield access = 0x%X)",
           target, offset, length, access);
@@ -8772,7 +8772,7 @@
     return NULL;
 }
 
-void __stdcall glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length)
+void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length)
 {
     EVENT("(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr length = %d)", target, offset, length);
 
@@ -8820,7 +8820,7 @@
     }
 }
 
-__eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname)
+__eglMustCastToProperFunctionPointerType EGLAPIENTRY glGetProcAddress(const char *procname)
 {
     struct Extension
     {
@@ -8878,7 +8878,7 @@
 
 // Non-public functions used by EGL
 
-bool __stdcall glBindTexImage(egl::Surface *surface)
+bool EGLAPIENTRY glBindTexImage(egl::Surface *surface)
 {
     EVENT("(egl::Surface* surface = 0x%0.8p)",
           surface);