mapi: Fix shared-glapi build with MSVC
authorJesse Natalie <jenatali@microsoft.com>
Wed, 1 Sep 2021 13:57:40 +0000 (06:57 -0700)
committerJesse Natalie <jenatali@microsoft.com>
Wed, 8 Sep 2021 14:21:26 +0000 (07:21 -0700)
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>

src/mapi/mapi_glapi.c
src/mapi/stub.c
src/mapi/u_current.h

index 21ca0a0..afc4665 100644 (file)
@@ -121,7 +121,7 @@ _glapi_add_dispatch( const char * const * function_names,
    const struct mapi_stub *alias = NULL;
    unsigned i;
 
-   (void) memset(function_stubs, 0, sizeof(function_stubs));
+   (void) memset((void*)function_stubs, 0, sizeof(function_stubs));
 
    /* find the missing stubs, and decide the alias */
    for (i = 0; function_names[i] != NULL && i < 8; i++) {
index 45e4f7d..2aefdbe 100644 (file)
@@ -65,7 +65,7 @@ stub_compare(const void *key, const void *elem)
    const struct mapi_stub *stub = (const struct mapi_stub *) elem;
    const char *stub_name;
 
-   stub_name = &public_string_pool[(unsigned long) stub->name];
+   stub_name = &public_string_pool[(size_t) stub->name];
 
    return strcmp(name, stub_name);
 }
@@ -193,7 +193,7 @@ stub_get_name(const struct mapi_stub *stub)
 
    if (stub >= public_stubs &&
        stub < public_stubs + ARRAY_SIZE(public_stubs))
-      name = &public_string_pool[(unsigned long) stub->name];
+      name = &public_string_pool[(size_t) stub->name];
    else
       name = (const char *) stub->name;
 
index 52da534..a717162 100644 (file)
@@ -50,13 +50,13 @@ u_current_destroy(void);
 void
 u_current_set_table(const struct _glapi_table *tbl);
 
-struct _glapi_table *
+_GLAPI_EXPORT struct _glapi_table *
 u_current_get_table_internal(void);
 
 void
 u_current_set_context(const void *ptr);
 
-void *
+_GLAPI_EXPORT void *
 u_current_get_context_internal(void);
 
 #endif /* _U_CURRENT_H_ */