[Python-Dev] Adventures with x64, VS7 and VS8 on Windows (original) (raw)
Mark Hammond mhammond at skippinet.com.au
Tue May 22 04:58:45 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 Marc-Andre,
+1 from me.
If 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?
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 Py_USING_UNICODE
-/* Define as the integral type used for Unicode representation. */ -#define PY_UNICODE_TYPE unsigned short
/* Define as the size of the unicode type. / -#define Py_UNICODE_SIZE SIZEOF_SHORT +/ This is enough for unicodeobject.h to do the "right thing" on Windows. */ +#define Py_UNICODE_SIZE 2
-/* Define if you have a useable wchar_t type defined in wchar.h; useable - means wchar_t must be 16-bit unsigned type. (see - Include/unicodeobject.h). */ -#if Py_UNICODE_SIZE == 2 -#define HAVE_USABLE_WCHAR_T
/* Define to indicate that the Python Unicode representation can be passed as-is to Win32 Wide API. */ #define Py_WIN_WIDE_FILENAMES -#endif
/* Use Python's own small-block memory-allocator. */ #define WITH_PYMALLOC 1
- 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 ]