More on cpp class declaration_code
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 9 Jun 2009 04:17:53 +0000 (21:17 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 9 Jun 2009 04:17:53 +0000 (21:17 -0700)
Cython/Compiler/PyrexTypes.py

index 6a54d91e9b977f677d81673a059e16d7b2780d38..001beb25de06adacd031b53dedc43f4b57e16c1d 100644 (file)
@@ -1388,12 +1388,12 @@ class CppClassType(CType):
 
     def declaration_code(self, entity_code, for_display = 0, dll_linkage = None, pyrex = 0):
         if for_display or pyrex:
-            return self.name
+            name = self.name
         else:
-            cname = self.cname
+            name = self.cname
             if self.namespace is not None:
-                cname = "%s::%s" % (self.namespace.replace('.', '::'), cname)
-            return cname
+                name = "%s::%s" % (self.namespace.replace('.', '::'), name)
+        return "%s %s" % (name, entity_code)
 
     def is_subclass(self, other_type):
         if not base_classes.empty():