Commit dc7a4af6 authored by Lisandro Dalcin's avatar Lisandro Dalcin

use unmangled objstruct cname for ctypedef public classes

parent 8cda3988
......@@ -227,7 +227,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
h_code.putln("%s DL_IMPORT(PyTypeObject) %s;" % (
Naming.extern_c_macro,
type.typeobj_cname))
#self.generate_obj_struct_definition(type, h_code)
def generate_cclass_include_code(self, type, i_code):
i_code.putln("cdef extern class %s.%s:" % (
......@@ -390,9 +389,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
elif type.is_enum:
self.generate_enum_definition(entry, code)
elif type.is_extension_type and entry not in vtabslot_entries:
self.generate_obj_struct_definition(type, code)
self.generate_objstruct_definition(type, code)
for entry in vtabslot_list:
self.generate_obj_struct_definition(entry.type, code)
self.generate_objstruct_definition(entry.type, code)
for entry in vtab_list:
self.generate_typeobject_predeclaration(entry, code)
self.generate_exttype_vtable_struct(entry, code)
......@@ -658,7 +657,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
elif type.is_enum:
self.generate_enum_definition(entry, code)
elif type.is_extension_type:
self.generate_obj_struct_definition(type, code)
self.generate_objstruct_definition(type, code)
def generate_gcc33_hack(self, env, code):
# Workaround for spurious warning generation in gcc 3.3
......@@ -804,7 +803,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
type.vtabstruct_cname,
type.vtabptr_cname))
def generate_obj_struct_definition(self, type, code):
def generate_objstruct_definition(self, type, code):
code.mark_pos(type.pos)
# Generate object struct definition for an
# extension type.
......@@ -1509,7 +1508,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if type.typedef_flag:
objstruct = type.objstruct_cname
else:
#objstruct = "struct %s" % scope.parent_type.objstruct_cname
objstruct = "struct %s" % type.objstruct_cname
code.putln(
"sizeof(%s), /*tp_basicsize*/" %
......
......@@ -517,10 +517,10 @@ class PyExtensionType(PyObjectType):
return self.base_declaration_code(self.name, entity_code)
else:
if self.typedef_flag:
base_format = "%s"
objstruct = self.objstruct_cname
else:
base_format = "struct %s"
base = public_decl(base_format % self.objstruct_cname, dll_linkage)
objstruct = "struct %s" % self.objstruct_cname
base = public_decl(objstruct, dll_linkage)
if deref:
return "%s %s" % (base, entity_code)
else:
......
......@@ -948,7 +948,6 @@ class ModuleScope(Scope):
if visibility != 'public':
warning(pos, "ctypedef only valid for public and extern classes", 2)
objtypedef_cname = objstruct_cname
objstruct_cname = None
typedef_flag = 0
else:
objtypedef_cname = None
......
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