python module patch

Reini Urban rurban@x-ray.at
Sat Aug 18 11:36:00 GMT 2007


On order to compile some python modules I needed the attached patch.
Can the maintainer confirm this? Or Yaakov?

extern __declspec(dllexport) cannot be used as constant during compile-time.
=> "initializer element is not constant"
cygwin auto-import feature get's that right at link-time.

This is needed for the constant (compile-time) resolution of 
PyObject_HEAD_INIT(&PyType_Type) in a typical PyTypeObject struct.

As workaround overriding this in object.h helped also:

diff -ub /usr/include/python2.5/object.h.orig 
/usr/include/python2.5/object.h
--- /usr/include/python2.5/object.h.orig        2007-06-20 
03:57:08.001000000 +0000
+++ /usr/include/python2.5/object.h     2007-08-18 10:37:03.937500000 +0000
@@ -372,7 +372,7 @@
  #define PyObject_TypeCheck(ob, tp) \
         ((ob)->ob_type == (tp) || PyType_IsSubtype((ob)->ob_type, (tp)))

-PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */
+extern PyTypeObject PyType_Type; /* built-in 'type' */
  PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */
  PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */


-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/
http://helsinki.at/  http://spacemovie.mur.at/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PyAPI_DATA-cyg.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070818/bd2633f5/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list