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
555559f4
Commit
555559f4
authored
Apr 12, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge 0.20.x branch into master
parents
8939521b
fd455597
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-2
tests/run/struct_conversion_extern.pyx
tests/run/struct_conversion_extern.pyx
+22
-0
tests/run/struct_conversion_extern_header.h
tests/run/struct_conversion_extern_header.h
+5
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
555559f4
...
@@ -2875,7 +2875,8 @@ class CStructOrUnionType(CType):
...
@@ -2875,7 +2875,8 @@ class CStructOrUnionType(CType):
if
env
.
outer_scope
is
None
:
if
env
.
outer_scope
is
None
:
return
False
return
False
if
self
.
_convert_to_py_code
is
False
:
return
None
# tri-state-ish
if
self
.
_convert_to_py_code
is
False
:
return
None
# tri-state-ish
if
self
.
_convert_to_py_code
is
None
:
if
self
.
_convert_to_py_code
is
None
:
for
member
in
self
.
scope
.
var_entries
:
for
member
in
self
.
scope
.
var_entries
:
...
@@ -2893,7 +2894,8 @@ class CStructOrUnionType(CType):
...
@@ -2893,7 +2894,8 @@ class CStructOrUnionType(CType):
if
env
.
outer_scope
is
None
:
if
env
.
outer_scope
is
None
:
return
False
return
False
if
self
.
_convert_from_py_code
is
False
:
return
None
# tri-state-ish
if
self
.
_convert_from_py_code
is
False
:
return
None
# tri-state-ish
if
self
.
_convert_from_py_code
is
None
:
if
self
.
_convert_from_py_code
is
None
:
for
member
in
self
.
scope
.
var_entries
:
for
member
in
self
.
scope
.
var_entries
:
...
...
tests/run/struct_conversion_extern.pyx
0 → 100644
View file @
555559f4
"""
Note: this tests if the necessary utility code is included in the module env,
despite potentially being already created before.
"""
cdef
extern
from
"struct_conversion_extern_header.h"
:
cdef
struct
my_date_t
:
int
year
int
month
int
day
def
test_extern_struct
():
"""
>>> test_extern_struct()
[('day', 24), ('month', 6), ('year', 2000)]
"""
cdef
my_date_t
day
=
my_date_t
(
year
=
2000
,
month
=
6
,
day
=
24
)
cdef
object
d
=
day
assert
type
(
d
)
is
dict
assert
d
==
day
return
sorted
(
day
.
items
())
tests/run/struct_conversion_extern_header.h
0 → 100644
View file @
555559f4
struct
my_date_t
{
int
year
;
int
month
;
int
day
;
};
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