[Python-Dev] Adventures with x64, VS7 and VS8 on Windows (original) (raw)
M.-A. Lemburg mal at egenix.com
Tue May 22 10:57:22 CEST 2007
- Previous message: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows
- Next message: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Mark,
+1 from me.
I think this is simply a bug introduced with the UCS4 patches in Python 2.2. unicodeobject.h already has this code: #ifndef PYUNICODETYPE /* Windows has a usable wchart type (unless we're using UCS-4) */ # if defined(MSWIN32) && PyUNICODESIZE == 2 # define HAVEUSABLEWCHART # define PYUNICODETYPE wchart # endif # if defined(PyUNICODEWIDE) # define PYUNICODETYPE PyUCS4 # endif #endif But for some reason, pyconfig.h defines: /* Define as the integral type used for Unicode representation. */ #define PYUNICODETYPE unsigned short /* Define as the size of the unicode type. */ #define PyUNICODESIZE SIZEOFSHORT /* Define if you have a useable wchart type defined in wchar.h; useable means wchart must be 16-bit unsigned type. (see Include/unicodeobject.h). */ #if PyUNICODESIZE == 2 #define HAVEUSABLEWCHART #endif disabling the default settings in the unicodeobject.h. Yes, that does appear strange. The following patch works for me, keeps Python building and appears to solve my problem. Any objections?
Looks fine to me.
Mark
Index: pyconfig.h =================================================================== --- pyconfig.h (revision 55487) +++ pyconfig.h (working copy) @@ -491,22 +491,13 @@ /* Define if you want to have a Unicode type. */ #define PyUSINGUNICODE -/* Define as the integral type used for Unicode representation. */ -#define PYUNICODETYPE unsigned short - /* Define as the size of the unicode type. */ -#define PyUNICODESIZE SIZEOFSHORT +/* This is enough for unicodeobject.h to do the "right thing" on Windows. */ +#define PyUNICODESIZE 2 -/* Define if you have a useable wchart type defined in wchar.h; useable - means wchart must be 16-bit unsigned type. (see - Include/unicodeobject.h). */ -#if PyUNICODESIZE == 2 -#define HAVEUSABLEWCHART - /* Define to indicate that the Python Unicode representation can be passed as-is to Win32 Wide API. */ #define PyWINWIDEFILENAMES -#endif /* Use Python's own small-block memory-allocator. */ #define WITHPYMALLOC 1
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/mal%40egenix.com
-- Marc-Andre Lemburg eGenix.com
Professional Python Services directly from the Source (#1, May 22 2007)
Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611
- Previous message: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows
- Next message: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]