Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Fri, 11 May 2001 11:26:13 -0400 From: Jason Tishler To: Ernesto Revilla Cc: pgsql-cygwin AT postgresql DOT org, cygwin AT sources DOT redhat DOT com Subject: Re: Perl + Python Postgresql 7.1.1 under Cygwin Message-ID: <20010511112613.A421@dothill.com> Mail-Followup-To: Ernesto Revilla , pgsql-cygwin AT postgresql DOT org, cygwin AT sources DOT redhat DOT com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tGfHPXZsG0ja3idf" Content-Disposition: inline In-Reply-To: <000e01c0d9a7$eacd9000$8faaa6d4@k6> User-Agent: Mutt/1.3.18i Organization: Dot Hill Systems Corp. --tGfHPXZsG0ja3idf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Erny, On Fri, May 11, 2001 at 01:21:07AM +0200, Ernesto Revilla wrote: > For the Python interface to compile, I had to add the -DMS_WIN32 in the > Makefile.pre.in . If not a 'not constant type' happens in pgmodule.c line > 951. I don't know if there is a better place tu put the def. After this it > compiles and seems to work well. I used Python 2.1. While changing Cygwin Python to build its core as a DLL (like Win32 Python) to support shared extension modules, I have learned that Guido prefers the style of the attached patch to solve the above problem. I feel that this solution is particularly appropriate in this case because the following: PglargeType PgType PgQueryType are already being handled in the way that I am proposing for PgSourceType. I will submit this patch to pgsql-patches for consideration. 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 DOT Tishler AT dothill DOT com Hazlet, NJ 07730 USA WWW: http://www.dothill.com --tGfHPXZsG0ja3idf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pgpy.patch" Index: pgmodule.c =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/python/pgmodule.c,v retrieving revision 1.18 diff -u -p -r1.18 pgmodule.c --- pgmodule.c 2001/05/02 11:17:24 1.18 +++ pgmodule.c 2001/05/11 12:01:03 @@ -947,11 +947,7 @@ pgsource_print(pgsourceobject * self, FI /* query type definition */ staticforward PyTypeObject PgSourceType = { -#ifndef MS_WIN32 - PyObject_HEAD_INIT(&PyType_Type) -#else PyObject_HEAD_INIT(NULL) -#endif 0, /* ob_size */ "pgsourceobject", /* tp_name */ @@ -3141,7 +3137,8 @@ init_pg(void) *v; /* Initialize here because some WIN platforms get confused otherwise */ - PglargeType.ob_type = PgType.ob_type = PgQueryType.ob_type = &PyType_Type; + PglargeType.ob_type = PgType.ob_type = PgQueryType.ob_type = + PgSourceType.ob_type = &PyType_Type; /* Create the module and add the functions */ mod = Py_InitModule4("_pg", pg_methods, pg__doc__, NULL, PYTHON_API_VERSION); --tGfHPXZsG0ja3idf Content-Type: text/plain; charset=us-ascii -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple --tGfHPXZsG0ja3idf--