diff options
author | Jeremy Huddleston <[email protected]> | 2011-06-13 11:35:18 -0700 |
---|---|---|
committer | Jeremy Huddleston <[email protected]> | 2011-06-13 14:50:37 -0700 |
commit | b44d13e67bfe81b2d7af4aeda2c3caf7f252bd0f (patch) | |
tree | 8ac62557b4005e0dba9b9ba5c9240fd11277377a /src/mapi/glapi/gen/gl_gentable.py | |
parent | df8d26ec09e7aecea91d8babbe82caf722f3dd2b (diff) |
glapi: Add check for NULL symbol_prefix in gentable and fix warnings
Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen/gl_gentable.py')
-rw-r--r-- | src/mapi/glapi/gen/gl_gentable.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index 0dfebf87f2b..73986f27253 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -42,7 +42,6 @@ header = """ #include "glapi.h" #include "glapitable.h" -#include "main/dispatch.h" struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { @@ -50,7 +49,10 @@ _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { char symboln[512]; if(!disp) - return NULL; + return NULL; + + if(symbol_prefix == NULL) + symbol_prefix = ""; """ footer = """ @@ -60,8 +62,9 @@ footer = """ body_template = """ if(!disp->%(name)s) { - snprintf(symboln, sizeof(symboln), "%%s%(entry_point)s", symbol_prefix); - SET_%(name)s(disp, dlsym(handle, symboln)); + snprintf(symboln, sizeof(symboln), "%%s%(entry_point)s", symbol_prefix); + _glapi_proc *procp = (_glapi_proc *)&disp->%(name)s; + *procp = (_glapi_proc) dlsym(handle, symboln); } """ |