From 7be8e671f1fac98fb26155d4804ba005e6b75b0f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 12 Jun 2008 01:00:29 -0400 Subject: Params: Allow nested namespaces in cxx_namespace --- src/python/m5/SimObject.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/python/m5') 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: -- cgit v1.2.3