diff options
author | Nathan Binkert <nate@binkert.org> | 2008-10-10 21:45:34 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2008-10-10 21:45:34 -0700 |
commit | 1f57193439925d2098052d0648031dc04b1ad440 (patch) | |
tree | 847380e1494a8edcc11fbbe7fc5ee8d2d09a5b72 /src/SConscript | |
parent | 96936c6bf57b40c6da2582ad6dd1bdd0de2ea3db (diff) | |
download | gem5-1f57193439925d2098052d0648031dc04b1ad440.tar.xz |
swig: Add in a %rename to allow the same name to appear in multiple namespaces.
Diffstat (limited to 'src/SConscript')
-rw-r--r-- | src/SConscript | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/SConscript b/src/SConscript index be721d57e..2ea35b778 100644 --- a/src/SConscript +++ b/src/SConscript @@ -532,11 +532,18 @@ def buildParams(target, source, env): continue class_path = obj.cxx_class.split('::') - class_path.reverse() - classname = class_path[0] - namespaces = class_path[1:] + classname = class_path[-1] + namespaces = class_path[:-1] + namespaces.reverse() code = '' + + if namespaces: + code += '// avoid name conflicts\n' + sep_string = '_COLONS_' + flat_name = sep_string.join(class_path) + code += '%%rename(%s) %s;\n' % (flat_name, classname) + code += '// stop swig from creating/wrapping default ctor/dtor\n' code += '%%nodefault %s;\n' % classname code += 'class %s ' % classname |