Cygwin Patch
Jason Tishler
Jason.Tishler at dothill.com
Tue Mar 6 17:14:21 CET 2001
My Cygwin patches to Python have been accepted into Python CVS so
Cygwin Python has supported shared extensions since 2.1a1. I have
redone my Cygwin python-ldap patch against the current python-ldap CVS.
Please consider this patch for acceptance into python-ldap CVS.
The procedure to apply the patch is as follows:
$ # save the attachment to /tmp
$ cd python-ldap/Modules
$ patch </tmp/cygwin.patch
See the following for my original posting:
On Wed, Dec 27, 2000 at 09:37:50AM -0500, Jason Tishler wrote:
> On Sun, 10 Dec 2000 23:27:49 +0100, David Leonard wrote:
> > * python-ldap-1.10 will be tidied up, with just the memory-leak
> > patches applied, and a proper documentation build. (ie no v3
> > changes will be applied as it breaks v2 builds.) A final release
> > will be made.
>
> Hopefully, the attached patch (against python-ldap-1.10alpha3) can
> still be considered for inclusion in the 1.10 final release. It enables
> python-ldap to build OOTB as a shared extension for Cygwin Python.
>
> Cygwin is an open-source POSIX emulation layer that enables many
> GNU and UNIX tools to port to Windows without any source code changes.
> If interested, please see http://www.cygwin.com for more information.
>
> Note that the patch has no functional changes -- it only enables the
> code to compile cleanly with Cygwin gcc. Specifically, the changes
> are as follows:
>
> 1. replaced #ifdef WIN32 with #if defined(WIN32) || defined(__CYGWIN__)
> as described in http://www.python.org/doc/FAQ.html#3.24
> 2. added DL_EXPORT to init_ldap()
>
> I'm quite willing to redo the patch against python-ldap CVS if that
> will facilitate its acceptance.
>
> My original plan was to wait until the Cygwin Python DLL and Shared
> Extension Patch:
>
> http://sourceforge.net/patch/?func=detailpatch&patch_id=102409&group_id=5470
>
> was accepted and committed into Python CVS before contacting the list.
> However, due to the impending 1.10 final release, I realized that it
> would be prudent to submit the patch sooner rather than later.
Thanks,
Jason
--
Jason Tishler
Director, Software Engineering Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp. Fax: +1 (732) 264-8798
82 Bethany Road, Suite 7 Email: Jason.Tishler at dothill.com
Hazlet, NJ 07730 USA WWW: http://www.dothill.com
-------------- next part --------------
Index: LDAPObject.c
===================================================================
RCS file: /cvsroot/python-ldap/python-ldap/Modules/LDAPObject.c,v
retrieving revision 1.8
diff -u -p -r1.8 LDAPObject.c
--- LDAPObject.c 2000/10/19 08:25:14 1.8
+++ LDAPObject.c 2001/03/06 15:24:52
@@ -1842,7 +1842,7 @@ setattr( LDAPObject* self, char* name, P
/* type entry */
PyTypeObject LDAP_Type = {
-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
/* see http://www.python.org/doc/FAQ.html#3.24 */
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
Index: ldapmodule.c
===================================================================
RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapmodule.c,v
retrieving revision 1.1
diff -u -p -r1.1 ldapmodule.c
--- ldapmodule.c 2000/07/27 16:08:58 1.1
+++ ldapmodule.c 2001/03/06 15:24:52
@@ -22,12 +22,12 @@ static PyMethodDef methods[] = {
/* module initialisation */
-void
+DL_EXPORT(void)
init_ldap()
{
PyObject *m, *d;
-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
/* See http://www.python.org/doc/FAQ.html#3.24 */
LDAP_Type.ob_type = &PyType_Type;
#endif
Index: linkedlist.c
===================================================================
RCS file: /cvsroot/python-ldap/python-ldap/Modules/linkedlist.c,v
retrieving revision 1.4
diff -u -p -r1.4 linkedlist.c
--- linkedlist.c 2000/08/13 15:03:25 1.4
+++ linkedlist.c 2001/03/06 15:24:53
@@ -111,7 +111,7 @@ static PySequenceMethods default_methods
};
static PyTypeObject default_type = {
-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
/* see http://www.python.org/doc/FAQ.html#3.24 */
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
Index: template.c
===================================================================
RCS file: /cvsroot/python-ldap/python-ldap/Modules/template.c,v
retrieving revision 1.6
diff -u -p -r1.6 template.c
--- template.c 2000/08/13 14:57:52 1.6
+++ template.c 2001/03/06 15:24:56
@@ -548,7 +548,7 @@ TemplateItem_setattr(self, attr, value)
}
static PyTypeObject TemplateItem_Type = {
-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
@@ -725,7 +725,7 @@ fprintf(stderr, "TemplateDefault_repr RE
}
static PyTypeObject TemplateDefault_Type = {
-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
@@ -908,7 +908,7 @@ Template_setattr(self, attr, value)
}
static PyTypeObject Template_Type = {
-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
More information about the python-ldap
mailing list