
On 30/04/12 20:34, Emil Dotchevski wrote:
On Mon, Apr 30, 2012 at 11:02 AM, Mathias Gaunard< mathias.gaunard@ens-lyon.org> wrote:
Exceptions types need to be exported so that shared libraries work correctly.
Currently, the only code I see that does this is in Boost.Exception :
[...]
But shouldn't we have macros to make this work with other compilers too? I'm not sure all unix-like compilers pretend to be GCC 4.1+.
Sure, if this causes a problem with any compiler, it should be fixed.
Looking at macros in Boost.Config, I found the macro BOOST_SYMBOL_VISIBLE which seems to be for that purpose. It is probably a bug that Boost.Exception does not use it, I'll file a ticket for this. It also might be a good idea to add a test that tests whether throwing/catching boost::exception across shared library boundaries with default hidden visibility works correctly. The test would probably fail with Sun CC shared libraries compiled with -xldscope=hidden.