Commit 6f1209a6 authored by gsamain's avatar gsamain Committed by Xavier Thompson

Use __activate__ entry when declaring it inside activable classes

parent 5a141faf
...@@ -1018,10 +1018,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1018,10 +1018,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
has_virtual_methods = False has_virtual_methods = False
constructor = None constructor = None
destructor = None destructor = None
if entry.type.is_cyp_class and entry.type.activable:
activated_class_entry = scope.lookup_here("Activated") activated_class_entry = scope.lookup_here("Activated")
if activated_class_entry:
code.putln("struct %s;" % activated_class_entry.cname) code.putln("struct %s;" % activated_class_entry.cname)
code.putln("%s;" % activated_class_entry.type.declaration_code("__activate__(void)")) dunder_activate_entry = scope.lookup_here("__activate__")
code.putln("%s;" % dunder_activate_entry.type.declaration_code(dunder_activate_entry.cname))
for attr in scope.var_entries: for attr in scope.var_entries:
cname = attr.cname cname = attr.cname
if attr.type.is_cfunction and attr.type.is_static_method: if attr.type.is_cfunction and attr.type.is_static_method:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment