summaryrefslogtreecommitdiff
path: root/lib/mesa/src/mapi/glapi/gen/gl_gentable.py
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2018-10-23 06:36:00 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2018-10-23 06:36:00 +0000
commitb65fcab046d3a1b6b6ac315720df220925c5322e (patch)
treeff73dcc383ac0799c655ff6194cda9dacb75dde9 /lib/mesa/src/mapi/glapi/gen/gl_gentable.py
parent18d6381c51e253e4c41c62619f80d9ce745b95c8 (diff)
Merge Mesa 17.3.9
Mesa 18.x needs an ld with build-id for at least the intel code Mesa 18.2 assumes linux only memfd syscalls in intel code Tested by matthieu@, kettenis@ and myself on a variety of hardware and architectures. ok kettenis@
Diffstat (limited to 'lib/mesa/src/mapi/glapi/gen/gl_gentable.py')
-rw-r--r--lib/mesa/src/mapi/glapi/gen/gl_gentable.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/mesa/src/mapi/glapi/gen/gl_gentable.py b/lib/mesa/src/mapi/glapi/gen/gl_gentable.py
index 7cd475aa2..50153bbab 100644
--- a/lib/mesa/src/mapi/glapi/gen/gl_gentable.py
+++ b/lib/mesa/src/mapi/glapi/gen/gl_gentable.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# (C) Copyright Apple Inc. 2011
@@ -57,6 +56,7 @@ header = """/* GLXEXT is the define used in the xserver when the GLX extension i
#endif
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "main/glheader.h"
@@ -145,6 +145,19 @@ _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
return disp;
}
+
+void
+ _glapi_table_patch(struct _glapi_table *table, const char *name, void *wrapper)
+{
+ for (int func_index = 0; func_index < GLAPI_TABLE_COUNT; ++func_index) {
+ if (!strcmp(_glapi_table_func_names[func_index], name)) {
+ ((void **)table)[func_index] = wrapper;
+ return;
+ }
+ }
+ fprintf(stderr, "could not patch %s in dispatch table\\n", name);
+}
+
"""