delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/02/16:42:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 02 Jan 2003 16:48:32 -0500
From: Jason Tishler <jason AT tishler DOT net>
Subject: Re: Cygwin gcc "initializer element is not constant" problem
In-reply-to: <Pine.GSO.4.44.0301021457290.8991-200000@slinky.cs.nyu.edu>
To: cygwin AT cygwin DOT com
Mail-followup-to: cygwin AT cygwin DOT com
Message-id: <20030102214832.GD1996@tishler.net>
MIME-version: 1.0
User-Agent: Mutt/1.4i
References: <20030102163008 DOT GF1524 AT tishler DOT net>
<Pine DOT GSO DOT 4 DOT 44 DOT 0301021457290 DOT 8991-200000 AT slinky DOT cs DOT nyu DOT edu>

--Boundary_(ID_UcnEmisMvc+CHVn/XvtMaw)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

Igor,

On Thu, Jan 02, 2003 at 03:03:21PM -0500, Igor Pechtchanski wrote:
> How about doing exactly what the message suggests (see attached)?

I think that I found the best solution -- auto-import the functions by
just removing the "__declspec(dllimport)" indicators.  If interested,
see attached.

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--Boundary_(ID_UcnEmisMvc+CHVn/XvtMaw)
Content-type: message/rfc822

Date: Thu, 02 Jan 2003 16:40:21 -0500
From: Jason Tishler <jason AT tishler DOT net>
Subject: Re: [Python-Dev] RE: [Python-checkins] python/dist/src/Modules
 _randommodule.c,1.1,1.2
In-reply-to: <BIEJKCLHCIOIHAGOKOLHEECAEGAA DOT tim DOT one AT comcast DOT net>
To: Tim Peters <tim DOT one AT comcast DOT net>
Cc: nnorwitz AT users DOT sourceforge DOT net, PythonDev <python-dev AT python DOT org>
Mail-followup-to: Tim Peters <tim DOT one AT comcast DOT net>,
 nnorwitz AT users DOT sourceforge DOT net, PythonDev <python-dev AT python DOT org>
Message-id: <20030102214021 DOT GC1996 AT tishler DOT net>
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_7gwCRlbtIBkAzdBtenjexQ)"
User-Agent: Mutt/1.4i
References: <E18TUM3-0003L6-00 AT sc8-pr-cvs1 DOT sourceforge DOT net>
 <BIEJKCLHCIOIHAGOKOLHEECAEGAA DOT tim DOT one AT comcast DOT net>


--Boundary_(ID_7gwCRlbtIBkAzdBtenjexQ)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

On Tue, Dec 31, 2002 at 05:14:17PM -0500, Tim Peters wrote:
> Please don't make this kind of change -- it makes the code so much
> harder to follow.  If this is needed for Cygwin, then, e.g., do
> 
> [snip]

I believe that I have found a cleaner solution to this problem.
Cygwin's ld can auto-import functions:

    http://www.cygwin.com/ml/cygwin-apps/2001-08/msg00024.html

Specifically, the following snippet is the most pertinent:

    We "always" have allowed 'auto-import' of *functions* that are
    exported by the DLL (as long as the DLL contains the appropriate
    symbols).

Note I don't believe that "always" pertained when I first started down
this path in the Python 2.0 time frame.

Anyway, with the attached patch to pyport.h, I was able to build Cygwin
Python without any errors.  Note this includes the new datetime module
from CVS -- not the patched one in sandbox.

I feel this is the best approach because modules should build under
Cygwin without the standard Cygwin style patch that I have been
submitting for years.  Do others concur?  If so, then I will begin to
clean up the "mess" that I have created.

Now if SF could search for patches by the submitter, my job would be a
little easier...

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--Boundary_(ID_7gwCRlbtIBkAzdBtenjexQ)
Content-type: text/plain; charset=us-ascii; NAME=pyport.h.diff
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=pyport.h.diff

Index: pyport.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v
retrieving revision 2.57
diff -u -p -r2.57 pyport.h
--- pyport.h	28 Dec 2002 21:56:07 -0000	2.57
+++ pyport.h	2 Jan 2003 20:51:50 -0000
@@ -429,7 +429,11 @@ and both these use __declspec()
 #		else /* Py_BUILD_CORE */
 			/* Building an extension module, or an embedded situation */
 			/* public Python functions and data are imported */
-#			define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE
+#			if defined(__CYGWIN__)
+#				define PyAPI_FUNC(RTYPE) RTYPE
+#			else /* __CYGWIN__ */
+#				define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE
+#			endif /* __CYGWIN__ */
 #			define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE
 			/* module init functions outside the core must be exported */
 #			if defined(__cplusplus)

--Boundary_(ID_7gwCRlbtIBkAzdBtenjexQ)--


--Boundary_(ID_UcnEmisMvc+CHVn/XvtMaw)
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--Boundary_(ID_UcnEmisMvc+CHVn/XvtMaw)--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019