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
Boxiang Sun
cython
Commits
25cf792f
Commit
25cf792f
authored
Feb 25, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excape comma in dll_linkage macros.
This allows return types such as std::map<K, V>. Fixes #1599
parent
299ad116
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-1
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+3
-0
tests/run/cpp_template_subclasses.pyx
tests/run/cpp_template_subclasses.pyx
+10
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
25cf792f
...
...
@@ -309,7 +309,7 @@ class PyrexType(BaseType):
def
public_decl
(
base_code
,
dll_linkage
):
if
dll_linkage
:
return
"%s(%s)"
%
(
dll_linkage
,
base_code
)
return
"%s(%s)"
%
(
dll_linkage
,
base_code
.
replace
(
','
,
' __PYX_COMMA '
)
)
else
:
return
base_code
...
...
Cython/Utility/ModuleSetupCode.c
View file @
25cf792f
...
...
@@ -24,6 +24,9 @@
#define DL_EXPORT(t) t
#endif
// For use in DL_IMPORT/DL_EXPORT macros.
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
// CPython has required PY_LONG_LONG support for years, even if HAVE_LONG_LONG is not defined for us
#if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
...
...
tests/run/cpp_template_subclasses.pyx
View file @
25cf792f
...
...
@@ -115,3 +115,13 @@ def testE(x, y):
finally
:
del
e
cdef
public
pair
[
int
,
double
]
public_return_pair
(
a
,
b
)
except
*
:
return
pair
[
int
,
double
](
a
,
b
)
def
test_GH1599
(
a
,
b
):
"""
>>> test_GH1599(1, 2)
(1, 2.0)
"""
return
public_return_pair
(
a
,
b
)
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