From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org, cygwin@cygwin.com
Subject: Re: 16-bit wchar_t on Windows and Cygwin
Date: Thu, 03 Feb 2011 10:48:00 -0000 [thread overview]
Message-ID: <201102031148.49143.bruno@clisp.org> (raw)
In-Reply-To: <20110203094142.GU2675@calimero.vinschen.de>
Corinna Vinschen wrote:
> isn't wwchar_t equivalent to wint_t on all
> platforms? On UCS-4 platforms sizeof(wint_t) == sizeof(wchar_t) == 4
> because there's no reason to make it bigger. On UCS-2 and UTF-16
> platforms sizeof(wint_t) == 4 because it must be able to hold EOF as
> well. So, why not just use the wint_t type for the time being?
The "must be able to hold WEOF as well" argument holds for the argument
type of iswwalpha. If we were to call it 'wwint_t', it would be the same as
'wint_t', yes. For this reason, we don't need a separate type 'wwint_t'.
But 'wwchar_t' is the base type for wide wide character _arrays_.
Such arrays don't need to hold the WEOF value. On AIX platforms, where
wchar_t[] is the UCS-2 encoding, wwchar_t[] can be synonymous to it.
There is no need to make wwchar_t 32 bits wide on these platforms.
So, my current code looks like this:
# if (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__
/* Define 'wwchar_t' as a type that
- can hold 32 bits, unlike wchar_t which can hold only 16 bits,
- promotes to 'wint_t' under the default argument promotions. */
typedef wint_t wwchar_t; /* actually 'unsigned int' or 'uint32_t' */
# else
typedef wchar_t wwchar_t;
# endif
Bruno
--
In memoriam Buddy Holly <http://en.wikipedia.org/wiki/Buddy_Holly>
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
prev parent reply other threads:[~2011-02-03 10:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201101310304.42975.bruno@clisp.org>
2011-01-31 19:16 ` Eric Blake
2011-01-31 20:49 ` Corinna Vinschen
2011-02-02 11:29 ` Bruno Haible
2011-02-02 12:15 ` Corinna Vinschen
2011-02-02 12:21 ` Corinna Vinschen
2011-02-02 16:03 ` Bruno Haible
2011-02-02 16:28 ` Corinna Vinschen
2011-02-02 16:35 ` Corinna Vinschen
2011-02-02 20:28 ` Andy Koppe
2011-02-04 22:46 ` Warren Young
2011-02-02 17:52 ` bug#7948: " Paul Eggert
2011-02-02 18:57 ` Bruno Haible
2011-02-02 20:43 ` Andy Koppe
2011-02-03 12:57 ` Ulf Zibis
2011-02-02 21:24 ` Eric Blake
2011-02-02 21:39 ` Corinna Vinschen
2011-02-02 23:03 ` Bruno Haible
2011-02-02 23:19 ` Eric Blake
2011-02-03 0:13 ` Bruno Haible
2011-02-03 9:42 ` Corinna Vinschen
2011-02-03 10:48 ` Bruno Haible [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201102031148.49143.bruno@clisp.org \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).