glapi: Use GetProcAddress instead of dlsym on Windows.
authorVinson Lee <vlee@freedesktop.org>
Tue, 10 Jun 2014 01:07:07 +0000 (18:07 -0700)
committerVinson Lee <vlee@freedesktop.org>
Tue, 15 Jul 2014 05:21:10 +0000 (22:21 -0700)
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@freedesktop.org>
Acked-by: Brian Paul <brianp@vmware.com>
src/mapi/glapi/gen/gl_gentable.py

index d45a5e0ffc3e38b76cde2ab6f0f4dfaa23ce213e..9db6a773a997527494014deeefddaa0448267d17 100644 (file)
@@ -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
     }
 """