summaryrefslogtreecommitdiff
path: root/dispatch
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2014-07-17 19:45:15 +0100
committerJosé Fonseca <jfonseca@vmware.com>2014-07-17 19:45:15 +0100
commit7989f93e5f55a674abb06379205185e91e883956 (patch)
tree378dc892365c45a73a2b9f456d6caee88e9d81e0 /dispatch
parent8b04b5aca4b0a894de40f4d53ae9750222d349a8 (diff)
dispatch: Cleanup.
Diffstat (limited to 'dispatch')
-rw-r--r--dispatch/dispatch.py18
-rw-r--r--dispatch/glproc.py6
2 files changed, 8 insertions, 16 deletions
diff --git a/dispatch/dispatch.py b/dispatch/dispatch.py
index 60f95073..3ca3c568 100644
--- a/dispatch/dispatch.py
+++ b/dispatch/dispatch.py
@@ -48,15 +48,7 @@ def function_pointer_value(function):
class Dispatcher:
def header(self):
- # Must be implemented by derived classes, which should define, declare,
- # or implement something like:
- #
- # typedef void (*_PROC)(void);
- #
- # static _PROC _getPublicProcAddress(const char *name);
- # static _PROC _getPrivateProcAddress(const char *name);
- #
- raise NotImplementedError
+ pass
def dispatchModule(self, module):
for function in module.functions:
@@ -88,14 +80,8 @@ class Dispatcher:
print '}'
print
- def isFunctionPublic(self, module, function):
- return True
-
def getProcAddressName(self, module, function):
- if self.isFunctionPublic(module, function):
- return '_getPublicProcAddress'
- else:
- return '_getPrivateProcAddress'
+ raise NotImplementedError
def invokeGetProcAddress(self, module, function):
ptype = function_pointer_type(function)
diff --git a/dispatch/glproc.py b/dispatch/glproc.py
index 5b6f707c..2a0f7d75 100644
--- a/dispatch/glproc.py
+++ b/dispatch/glproc.py
@@ -506,6 +506,12 @@ void * _getPrivateProcAddress(const char *procName);
def isFunctionPublic(self, module, function):
return function.name in public_symbols or function.name.startswith('CGL')
+ def getProcAddressName(self, module, function):
+ if self.isFunctionPublic(module, function):
+ return '_getPublicProcAddress'
+ else:
+ return '_getPrivateProcAddress'
+
def failFunction(self, function):
# We fake this when they are not available
if function.name in ('glGetObjectLabel', 'glGetObjectPtrLabel', 'glGetObjectLabelEXT'):