From: Gabe Black Date: Thu, 12 Jun 2008 05:00:29 +0000 (-0400) Subject: Params: Allow nested namespaces in cxx_namespace X-Git-Tag: m5_2.0_beta6~128 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7be8e671f1fac98fb26155d4804ba005e6b75b0f;p=gem5.git Params: Allow nested namespaces in cxx_namespace --- 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: