Commit 25cf792f authored by Robert Bradshaw's avatar Robert Bradshaw

Excape comma in dll_linkage macros.

This allows return types such as std::map<K, V>.

Fixes #1599
parent 299ad116
......@@ -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
......
......@@ -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)
......
......@@ -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)
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