diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-12-06 22:21:51 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-12-18 17:45:05 +0800 |
commit | f88da95acc1e1255bb4cbf0eba3532c352d37be9 (patch) | |
tree | 5d6decef79e1425f2e4cf384e69dad4858a9b217 | |
parent | 7d0c11a8b9ca5a9f6ddf7e0a13407d8d0c187c7f (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.py | 7 |
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) |