[Mesa-dev] [PATCH] glapi: Use GetProcAddress instead of dlsym on Windows.
Brian Paul
brianp at vmware.com
Mon Jul 14 09:47:18 PDT 2014
On 07/11/2014 12:52 PM, Vinson Lee wrote:
> This patch fixes this MinGW build error.
>
> glapi_gentable.c: In function '_glapi_create_table_from_handle':
> glapi_gentable.c:123:9: error: implicit declaration of function 'dlsym' [-Werror=implicit-function-declaration]
> *procp = dlsym(handle, symboln);
> ^
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/mapi/glapi/gen/gl_gentable.py | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py
> index d45a5e0..9db6a77 100644
> --- a/src/mapi/glapi/gen/gl_gentable.py
> +++ b/src/mapi/glapi/gen/gl_gentable.py
> @@ -134,7 +134,11 @@ body_template = """
> if(!disp->%(name)s) {
> void ** procp = (void **) &disp->%(name)s;
> snprintf(symboln, sizeof(symboln), "%%s%(entry_point)s", symbol_prefix);
> +#ifdef _WIN32
> + *procp = GetProcAddress(handle, symboln);
> +#else
> *procp = dlsym(handle, symboln);
> +#endif
> }
> """
>
>
Hmm, I've been building on Mingw as-is for a long-time without ever
seeing this problem. That said, this patch doesn't seem to break
anything for me.
Acked-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list