Re: ANN: Pyrex 0.9.8.4

Sébastien Sablé <[email protected]> Wed, 11 Jun 2008 11:53:06 +0200
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
hi Greg,

my Pyrex module will not compile when switching from Pyrex 0.9.8.2 to 
Pyrex 0.9.8.4 (0.9.8.3 will not work either).

The error at compilation is this one:

magnum/magnum._magpy.c:42155: erreur: «Py_INCREF» undeclared (first use 
in this function)
magnum/magnum._magpy.c:42155: erreur: (Each undeclared identifier is 
reported only once
magnum/magnum._magpy.c:42155: erreur: for each function it appears in.)
magnum/magnum._magpy.c:42156: erreur: «Py_DECREF» undeclared (first use 
in this function)
magnum/magnum._magpy.c:42162: erreur: «PyList_SET_ITEM» undeclared 
(first use in this function)
...

When comparing the C file generated by Pyrex 0.9.8.2 and the one 
generated by 0.9.8.4, I find that Pyrex 0.9.8.4 adds many 
__Pyx_ExportFunction calls in the init_module function:

diff -u magpy.c-0.9.8.2 magpy.c-0.9.8.4
...
@@ -42220,6 +42133,243 @@
...
+  if (__Pyx_ExportFunction("g_malloc0", (void*)g_malloc0, "void 
*(int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto 
__pyx_L1;}
+  if (__Pyx_ExportFunction("Py_INCREF", (void*)Py_INCREF, "void 
(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto 
__pyx_L1;}
+  if (__Pyx_ExportFunction("Py_DECREF", (void*)Py_DECREF, "void 
(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto 
__pyx_L1;}
...

The offending line at compilation is the one starting by
"""if (__Pyx_ExportFunction("Py_INCREF"""" which was not generated when 
using Pyrex 0.9.8.2.

Thanks in advance

--
Sébastien Sablé


Greg Ewing a écrit :
> Pyrex 0.9.8.4 is now available:
> 
>    http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
> 
> This version fixes a bug introduced by the last change
> to unsigned integer indexing.
> 
> 
> What is Pyrex?
> --------------
> 
> Pyrex is a language for writing Python extension modules.
> It lets you freely mix operations on Python and C data, with
> all Python reference counting and error checking handled
> automatically.
> 
> _______________________________________________
> Pyrex mailing list
> [email protected]
> http://lists.copyleft.no/mailman/listinfo/pyrex