stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <>
Subject RE: do we still need rwstderr.rc?
Date Wed, 19 Sep 2007 18:32:49 GMT

Farid Zaripov wrote:
>Subject: Re: do we still need rwstderr.rc?
>I agree that if gencat would accept .msg files instead of .rc files it
>would be great improvement. But then we need to decide how to deal
>with possible multiple sets in .msg file. The .rc file doesn't have
>the sets. We can encode set number and message number to ID in .rc
>file (0 <= ID <= 0xffff):
>ID = set * 0x100 + msg        - 256 sets by 256 messages per set, or
>ID = set * 0x1000 + msg      - 16 sets by 4096 messages per set

This is a little off topic, but since it was just brought it up I figure
I should mention it. IMO, there is actually a pretty annoying
compatibility problem with this behavior. On windows, you cannot use
std::messages<>::get() as you would on non-windows platforms because the
set number is ignored on windows.

You can see evidence of this issue in the tests [22.locale.messages.cpp
and]. Those tests create a message catalog
with 5 sets of 5 messages. On a non-windows system, msgs.get (cat, 5, 5,
"") returns the fifth message in the fifth set, but on windows systems
it returns the fifth message in the _first_ set. The tests skirt around
this issue with a function named msg_id(). It takes a set number and a
message number and returns the actual message number using the scheme
mentioned above.

If there is only one message set in the catalog, there is no problem.
The other frustrating thing is that I wasn't able to find anything in
the documentation that mentioned this limitation, or the workaround. The
example sidesteps the issue in another way, by giving each message a
unique id.

Is this wrong, or am I just misinformed or confused?


>  BTW, I see that currently rwstderr.rc file is not used in build

View raw message