Re: [Python-checkins] CVS: python/dist/src/Modules _sre.c

tim indirectly wrote:
after this change, the separate makefile I use to build _sre on Windows no longer works (init_sre isn't exported). I don't really understand the code in config.h, but I've tried defining USE_DL_EXPORT (gives linking problems) and USE_DL_IMPORT (macro redefinition). any ideas? Cheers /F

[/F]
after this change, the separate makefile I use to build _sre on Windows no longer works (init_sre isn't exported).
Oops! I tested it on Windows, so it works OK with the std build.
I don't really understand the code in config.h,
Nobody does, alas. Mark Hammond and I have a delayed date to rework that.
but I've tried defining USE_DL_EXPORT (gives linking problems) and USE_DL_IMPORT (macro redefinition).
Sounds par for the course.
any ideas?
Ya: the great thing about all these macros is that they're usually worse than useless (you try them, they break something). The _sre project has /export:init_sre buried in its link options. DL_EXPORT(void) expands to void. Not pretty, but it's the way everything else (outside the pythoncore project) works too.

Fredrik, On Wed, Feb 28, 2001 at 06:36:09PM +0100, Fredrik Lundh wrote:
USE_DL_EXPORT is to be defined only when building the Win32 (and Cygwin) DLL core not when building extensions. When building Win32 Python, USE_DL_IMPORT is implicitly defined in PC/config.h when USE_DL_EXPORT is not. Explicitly defining USE_DL_IMPORT will cause the macro redefinition warning indicated above -- but no other ill or good effect. Another way to solve your problem without using the "/export:init_sre" link option is by patching PC/config.h with the attached. When I was converting Cygwin Python to use a DLL core instead of a static library one, I wondered why the USE_DL_IMPORT case was missing the following: #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE Anyway, sorry that I caused you some heartache. Jason P.S. If this patch is to be seriously considered, then the analogous change should be done for the other Win32 compilers (e.g. Borland). -- 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@dothill.com Hazlet, NJ 07730 USA WWW: http://www.dothill.com

[/F]
after this change, the separate makefile I use to build _sre on Windows no longer works (init_sre isn't exported).
Oops! I tested it on Windows, so it works OK with the std build.
I don't really understand the code in config.h,
Nobody does, alas. Mark Hammond and I have a delayed date to rework that.
but I've tried defining USE_DL_EXPORT (gives linking problems) and USE_DL_IMPORT (macro redefinition).
Sounds par for the course.
any ideas?
Ya: the great thing about all these macros is that they're usually worse than useless (you try them, they break something). The _sre project has /export:init_sre buried in its link options. DL_EXPORT(void) expands to void. Not pretty, but it's the way everything else (outside the pythoncore project) works too.

Fredrik, On Wed, Feb 28, 2001 at 06:36:09PM +0100, Fredrik Lundh wrote:
USE_DL_EXPORT is to be defined only when building the Win32 (and Cygwin) DLL core not when building extensions. When building Win32 Python, USE_DL_IMPORT is implicitly defined in PC/config.h when USE_DL_EXPORT is not. Explicitly defining USE_DL_IMPORT will cause the macro redefinition warning indicated above -- but no other ill or good effect. Another way to solve your problem without using the "/export:init_sre" link option is by patching PC/config.h with the attached. When I was converting Cygwin Python to use a DLL core instead of a static library one, I wondered why the USE_DL_IMPORT case was missing the following: #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE Anyway, sorry that I caused you some heartache. Jason P.S. If this patch is to be seriously considered, then the analogous change should be done for the other Win32 compilers (e.g. Borland). -- 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@dothill.com Hazlet, NJ 07730 USA WWW: http://www.dothill.com
participants (3)
-
Fredrik Lundh
-
Jason Tishler
-
Tim Peters