X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Fmapi_glapi.c;h=1cee148c89158233c36335cf51fc8502619f6218;hb=a8e2d79e0228106d11b6ceeb38f4ffb587f0a819;hp=a6838ce61e4918aa70d5275b69c28b2af489fbac;hpb=d5e9426b9605264608e0b1204ebf818103f1f011;p=mesa.git diff --git a/src/mapi/mapi_glapi.c b/src/mapi/mapi_glapi.c index a6838ce61e4..1cee148c891 100644 --- a/src/mapi/mapi_glapi.c +++ b/src/mapi/mapi_glapi.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.9 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2010 LunarG Inc. @@ -28,6 +27,7 @@ */ #include +#include #include "glapi/glapi.h" #include "u_current.h" #include "table.h" /* for MAPI_TABLE_NUM_SLOTS */ @@ -38,11 +38,11 @@ * u_current.c. */ -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS /* not used, but defined for compatibility */ const struct _glapi_table *_glapi_Dispatch; const void *_glapi_Context; -#endif /* GLX_USE_TLS */ +#endif /* USE_ELF_TLS */ void _glapi_destroy_multithread(void) @@ -59,13 +59,13 @@ _glapi_check_multithread(void) void _glapi_set_context(void *context) { - u_current_set_user((const void *) context); + u_current_set_context((const void *) context); } void _glapi_set_dispatch(struct _glapi_table *dispatch) { - u_current_set((const struct mapi_table *) dispatch); + u_current_set_table((const struct _glapi_table *) dispatch); } /** @@ -174,11 +174,6 @@ _glapi_get_stub(const char *name, int generate) { const struct mapi_stub *stub; -#ifdef USE_MGL_NAMESPACE - if (name) - name++; -#endif - if (!name || name[0] != 'g' || name[1] != 'l') return NULL; name += 2; @@ -223,10 +218,36 @@ _glapi_get_proc_name(unsigned int offset) return stub ? stub_get_name(stub) : NULL; } +/** Return pointer to new dispatch table filled with no-op functions */ +struct _glapi_table * +_glapi_new_nop_table(unsigned num_entries) +{ + struct _glapi_table *table; + + if (num_entries > MAPI_TABLE_NUM_SLOTS) + num_entries = MAPI_TABLE_NUM_SLOTS; + + table = malloc(num_entries * sizeof(mapi_func)); + if (table) { + memcpy(table, table_noop_array, num_entries * sizeof(mapi_func)); + } + return table; +} + +void +_glapi_set_nop_handler(_glapi_nop_handler_proc func) +{ + table_set_noop_handler(func); +} + +/** + * This is a deprecated function which should not be used anymore. + * It's only present to satisfy linking with older versions of libGL. + */ unsigned long _glthread_GetID(void) { - return u_thread_self(); + return 0; } void