------- Comment #25 from mrsam at courier-mta dot com  2009-06-16 11:07 -------
Yes, but, unfortunately, I just realized that this only partially fixes the
original issue. This would fix the use case where different parts of the
application use different locales, and different instances of std::messages to
open different message catalogs.

However, the use case of two different message catalogs being opened in the
same locale would still be broken, since there would still be one std::messages
bound to that locale. So, the application opening a message catalog in the
current locale, and a shared library opening a message catalog in the current
locale in order to retrieve messages using the shared library's text domain,
that's still broken here.

The text domain is not really an attribute of the std::messages object, but
rather an attribute of the opened catalog. Currently, do_open() always returns
0, and do_get() ignores the catalog parameter. There's the real problem.
do_open() needs to return a real handle, and the text domain needs to be
associated with the handle (and not saved in the messages object), and do_get()
must retrieve the text domain associated with that handle, and pass it to
dgettext(). This way, in this particular use case, the application and the
shared library will now use different catalog handles, and there's no longer
any text domain confusion.

It looks to me like there's really no choice here but to wait until libstdc++
major version can be bumped, and the ABI can be changed :-(. This whole thing
will have to wait for then. I tried to shoehorn this into the existing ABI, and
it simply doesn't fit all the way in.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13631

Reply via email to