projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99e2c12
)
only provide a fake PyObject_GetBuffer in Py2.5 and earlier
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 11 Jul 2008 14:40:28 +0000
(16:40 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 11 Jul 2008 14:40:28 +0000
(16:40 +0200)
Cython/Compiler/ModuleNode.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ModuleNode.py
b/Cython/Compiler/ModuleNode.py
index 20237b8eaa2a233708ab2f7b7f3af1eede3cc797..3dbdf90db8b9a93be421064bc1543ea4239afbe7 100644
(file)
--- a/
Cython/Compiler/ModuleNode.py
+++ b/
Cython/Compiler/ModuleNode.py
@@
-2010,6
+2010,7
@@
static void numpy_releasebuffer(PyObject *obj, Py_buffer *view) {
types.append((ndarrtype.typeptr_cname, "numpy_getbuffer", "numpy_releasebuffer"))
except KeyError:
pass
+ code.putln("#if PY_VERSION_HEX < 0x02060000")
code.putln("static int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {")
if len(types) > 0:
clause = "if"
@@
-2030,6
+2031,7
@@
static void numpy_releasebuffer(PyObject *obj, Py_buffer *view) {
clause = "else if"
code.putln("}")
code.putln("")
+ code.putln("#endif")
#------------------------------------------------------------------------------------