summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-06-12 01:00:29 -0400
committerGabe Black <gblack@eecs.umich.edu>2008-06-12 01:00:29 -0400
commit7be8e671f1fac98fb26155d4804ba005e6b75b0f (patch)
treea002fb866b356fe8bdb135ddfe8b6442742a5304 /src
parent5b5875341cb7d86ad7ce497666f0af526158775f (diff)
downloadgem5-7be8e671f1fac98fb26155d4804ba005e6b75b0f.tar.xz
Params: Allow nested namespaces in cxx_namespace
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/SimObject.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index 78df6bef1..d1aec44b3 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -217,7 +217,10 @@ class MetaSimObject(type):
# just declaring a pointer.
decl = 'class %s;' % _cxx_class
if namespace:
- decl = 'namespace %s { %s }' % (namespace, decl)
+ namespaces = namespace.split('::')
+ namespaces.reverse()
+ for namespace in namespaces:
+ decl = 'namespace %s { %s }' % (namespace, decl)
cls._value_dict['cxx_predecls'] = [decl]
if 'swig_predecls' not in cls._value_dict: