[Mesa-stable] [Review Request (main branch)] st/wgl: add WINAPI qualifiers on wgl function typedefs

Brian Paul brianp at vmware.com
Fri Oct 3 11:23:37 PDT 2014


Yeah, I thought calling conventions would behave the same with release 
and debug builds.  If I had copious spare time maybe I'd step through 
the machine code to see what's happening, but I'll have to save that fun 
for another day.

-Brian


On 10/03/2014 11:59 AM, Jose Fonseca wrote:
> Good find.
>
> I'm surprised this only caused problems on release builds. I'd expect that not using the stdcall convention would corrupt the stack for all build types.
>
> Jose
>
> ________________________________________
> From: mks-hackers-bounces at vmware.com <mks-hackers-bounces at vmware.com> on behalf of Brian Paul <brianp at vmware.com>
> Sent: 03 October 2014 16:59
> To: mks-hackers at vmware.com
> Cc: 10.3
> Subject: [Review Request (main branch)] st/wgl: add WINAPI qualifiers on wgl    function typedefs
>
> Fixes a release build segfault when wglCreateContextAttribsARB()
> calls the wglCreateContext() function.
>
> Cc: "10.3" <mesa-stable at lists.freedesktop.org>
> ---
>   src/gallium/state_trackers/wgl/stw_ext_context.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/wgl/stw_ext_context.c b/src/gallium/state_trackers/wgl/stw_ext_context.c
> index ac0077b..cfe4e8a 100644
> --- a/src/gallium/state_trackers/wgl/stw_ext_context.c
> +++ b/src/gallium/state_trackers/wgl/stw_ext_context.c
> @@ -50,8 +50,8 @@
>   HGLRC WINAPI
>   wglCreateContextAttribsARB(HDC hDC, HGLRC hShareContext, const int *attribList)
>   {
> -   typedef HGLRC (*wglCreateContext_t)(HDC hdc);
> -   typedef BOOL (*wglDeleteContext_t)(HGLRC hglrc);
> +   typedef HGLRC (WINAPI *wglCreateContext_t)(HDC hdc);
> +   typedef BOOL (WINAPI *wglDeleteContext_t)(HGLRC hglrc);
>      HGLRC context;
>      static HMODULE opengl_lib = 0;
>      static wglCreateContext_t wglCreateContext_func = 0;
> --
> 1.7.10.4
>
>



More information about the mesa-stable mailing list