This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients amaury.forgeotdarc, benjamin.peterson, georg.brandl, lemburg, pitrou, schuppenies
Date 2008-06-16.09:57:03
SpamBayes Score 0.002199465
Marked as misclassified No
Message-id <485638E3.7010403@egenix.com>
In-reply-to <1213389159.5912.13.camel@fsol>
Content
On 2008-06-13 22:32, Antoine Pitrou wrote:
> Antoine Pitrou <pitrou@free.fr> added the comment:
> 
> Le vendredi 13 juin 2008 à 20:18 +0000, Marc-Andre Lemburg a écrit :
>> AFAIK, only Crays have this problem, but apart from that: I'd consider
>> it a bug if sizeof(Py_UCS4) != 4.
> 
> Perhaps a #error can be added to that effect?
> Something like (untested):
> 
> #if SIZEOF_INT == 4 
> typedef unsigned int Py_UCS4; 
> #elif SIZEOF_LONG == 4
> typedef unsigned long Py_UCS4; 
> #else
> #error Could not find a 4-byte integer type for Py_UCS4, aborting
> #endif

Sounds good !

> (of course we could also try harder to find an appropriate type, but I'm
> no specialist in C integer variations)

Python should really try to use uint32_t as fallback solution for
UCS4 where available (and uint16_t for UCS2).

We'd have to add an AC_TYPE_INT32_T and AC_TYPE_INT16_T check to
configure:

http://www.gnu.org/software/autoconf/manual/html_node/Particular-Types.html#Particular-Types

and could then use

typedef uint32_t Py_UCS4

and

typedef uint16_t Py_UCS2

Note that the code for supporting UCS2/UCS4 is not really all that
clean. It was a quick sprint between Martin and Fredrik and appears
to be only half-done... e.g. there currently is no Py_UCS2.
History
Date User Action Args
2008-06-16 09:57:23lemburgsetspambayes_score: 0.00219946 -> 0.002199465
recipients: + lemburg, georg.brandl, amaury.forgeotdarc, pitrou, benjamin.peterson, schuppenies
2008-06-16 09:57:18lemburglinkissue3098 messages
2008-06-16 09:57:10lemburgcreate