[Python-Dev] Unicode fallout: Windows _winreg project broken

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed, 27 Jun 2001 09:12:11 +0200


> IOW, HAVE_USABLE_WCHAR_T no longer gets #define'd on Windows, and
> that prevents unicodeobject.c from supplying routines _winreg.c
> calls.

The best thing, IMO, would be if PC/config.h defines everything
available in config.h also. In this case, the proper defines would be

#define Py_USING_UNICODE
#define HAVE_USABLE_WCHAR_T
#define Py_UNICODE_SIZE 2
#define PY_UNICODE_TYPE wchar_t

If that approach is used, the defaulting in Include/unicodeobject.h
could go away.

Alternatively, define only Py_USING_UNICODE of this in PC/config.h,
and change the block in Include/unicodeobject.h to

/* Windows has a usable wchar_t type (unless we're using UCS-4) */
# ifdef MS_WIN32
# ifdef USE_UCS4_STORAGE
#  define Py_UNICODE_SIZE 4
#  define PY_UNICODE_TYPE unsigned int
# else
#  define Py_UNICODE_SIZE 2
#  define HAVE_USABLE_WCHAR_T
#  define PY_UNICODE_TYPE wchar_t
# endif
# endif

Regards,
Martin