summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-12-06 22:21:51 +0800
committerChia-I Wu <olv@lunarg.com>2010-12-18 17:45:05 +0800
commitf88da95acc1e1255bb4cbf0eba3532c352d37be9 (patch)
tree5d6decef79e1425f2e4cf384e69dad4858a9b217
parent7d0c11a8b9ca5a9f6ddf7e0a13407d8d0c187c7f (diff)
mapi: Allow prefix to be macro.
Treat prefix as macro when it is all uppercase. Generate PREFIX(name) instead of PREFIXname when it is a macro.
-rw-r--r--src/mapi/mapi/mapi_abi.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mapi/mapi/mapi_abi.py b/src/mapi/mapi/mapi_abi.py
index 4e76222534..c133bb171d 100644
--- a/src/mapi/mapi/mapi_abi.py
+++ b/src/mapi/mapi/mapi_abi.py
@@ -359,8 +359,11 @@ class ABIPrinter(object):
def _c_function(self, ent, prefix, mangle=False, stringify=False):
"""Return the function name of an entry."""
- formats = { True: '"%s%s"', False: '%s%s' }
- fmt = formats[stringify]
+ formats = {
+ True: { True: '%s_STR(%s)', False: '%s(%s)' },
+ False: { True: '"%s%s"', False: '%s%s' },
+ }
+ fmt = formats[prefix.isupper()][stringify]
name = ent.name
if mangle and ent.hidden:
name = '_dispatch_stub_' + str(ent.slot)