Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
140313e2
Commit
140313e2
authored
May 14, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #303 as per Lisandro's idea
parent
7ea04648
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+11
-4
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-1
No files found.
Cython/Compiler/Nodes.py
View file @
140313e2
...
@@ -793,10 +793,17 @@ class CVarDefNode(StatNode):
...
@@ -793,10 +793,17 @@ class CVarDefNode(StatNode):
dest_scope
=
env
dest_scope
=
env
self
.
dest_scope
=
dest_scope
self
.
dest_scope
=
dest_scope
base_type
=
self
.
base_type
.
analyse
(
env
)
base_type
=
self
.
base_type
.
analyse
(
env
)
if
(
dest_scope
.
is_c_class_scope
and
self
.
visibility
==
'public'
# If the field is an external typedef, we cannot be sure about the type,
# so do conversion ourself rather than rely on the CPython mechanism (through
# a property; made in AnalyseDeclarationsTransform).
# Also, if the type is an extension type, then the CPython mechanism does
# not do enough type-checking for us.
if
(
dest_scope
.
is_c_class_scope
and
((
self
.
visibility
==
'public'
and
base_type
.
is_pyobject
and
base_type
.
is_pyobject
and
(
base_type
.
is_builtin_type
or
base_type
.
is_extension_type
)):
and
(
base_type
.
is_builtin_type
or
base_type
.
is_extension_type
)
or
(
base_type
.
is_typedef
and
base_type
.
typedef_is_external
)))):
self
.
need_properties
=
[]
self
.
need_properties
=
[]
need_property
=
True
need_property
=
True
visibility
=
'private'
visibility
=
'private'
...
...
Cython/Compiler/PyrexTypes.py
View file @
140313e2
...
@@ -161,12 +161,15 @@ class CTypedefType(BaseType):
...
@@ -161,12 +161,15 @@ class CTypedefType(BaseType):
# qualified_name string
# qualified_name string
# typedef_cname string
# typedef_cname string
# typedef_base_type PyrexType
# typedef_base_type PyrexType
# typedef_is_external bool
is_typedef
=
1
is_typedef
=
1
typedef_is_external
=
0
def
__init__
(
self
,
cname
,
base_type
):
def
__init__
(
self
,
cname
,
base_type
,
is_external
=
0
):
self
.
typedef_cname
=
cname
self
.
typedef_cname
=
cname
self
.
typedef_base_type
=
base_type
self
.
typedef_base_type
=
base_type
self
.
typedef_is_external
=
is_external
def
resolve
(
self
):
def
resolve
(
self
):
return
self
.
typedef_base_type
.
resolve
()
return
self
.
typedef_base_type
.
resolve
()
...
...
Cython/Compiler/Symtab.py
View file @
140313e2
...
@@ -347,7 +347,7 @@ class Scope(object):
...
@@ -347,7 +347,7 @@ class Scope(object):
cname = name
cname = name
else:
else:
cname = self.mangle(Naming.type_prefix, name)
cname = self.mangle(Naming.type_prefix, name)
type = PyrexTypes.CTypedefType(cname, base_type)
type = PyrexTypes.CTypedefType(cname, base_type
, (visibility == 'extern')
)
entry = self.declare_type(name, type, pos, cname, visibility)
entry = self.declare_type(name, type, pos, cname, visibility)
type.qualified_name = entry.qualified_name
type.qualified_name = entry.qualified_name
return entry
return entry
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment