[New-bugs-announce] [issue9642] #ifdef and mbcs: don't check for defined(HAVE_USABLE_WCHAR_T)

STINNER Victor report at bugs.python.org
Thu Aug 19 14:02:28 CEST 2010


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

mbcs codec functions are surrounded by:

#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
(especially in unicodeobject.c and _codecsmodule.c)

or

#ifdef MS_WIN32
(in unicodeobject.h)

or

#if defined(MS_WINDOWS) && !defined(__BORLANDC__)
(in timemodule.c)

I think that all of these tests are wrong. We should just check that we are compiling under Windows: mbcs functions don't use the wchar_t type. And it's better to use the same test in all tests (MS_WIN32 vs MS_WINDOWS).

Attached patch replaces all #ifdef (except the one in timemodule.c because I don't know what to do with the BORLAND check, does anyone use this compiler?).

I suppose that my patch doesn't change anything in pratice because mbcs is used in many places and noboby complained that mbcs encoding was missing on Windows.

----------
components: Unicode, Windows
files: ifdef_mbcs.patch
keywords: patch
messages: 114350
nosy: brian.curtin, haypo, tim.golden
priority: normal
severity: normal
status: open
title: #ifdef and mbcs: don't check for defined(HAVE_USABLE_WCHAR_T)
versions: Python 3.2
Added file: http://bugs.python.org/file18577/ifdef_mbcs.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9642>
_______________________________________


More information about the New-bugs-announce mailing list