Boost logo

Boost :

Subject: Re: [boost] [config] Request for BOOST_SYMBOL_IMPORT_VISIBLE ?
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2011-02-07 03:10:26


On Mon, 31 Jan 2011 07:00:50 -0800, Alexander Arhipenko
<arhipjan_at_[hidden]> wrote:

> On Sat, Jan 29, 2011 at 2:37 AM, Mostafa
> <mostafa_working_away_at_[hidden]> wrote:
>> Hi,
>>
>> I propose the introduction of BOOST_SYMBOL_IMPORT_VISIBLE to
>> Boost.Config
>> that behaves like BOOST_SYMBOL_IMPORT in all cases except gcc (and like
>> compilers?) where it expands to
>> "__attribute__((visibility("default")))".
> [snip]...
>

[snip]

> The more elegant solution would be to have (as you are proposing) special
> macroses in boost.config. BOOST_SYMBOL_VISIBLE is okay but it does
> nothing on msvc.

That's the problem I ran into. On msvc, it's ok if all you want to do is
catch the exception outside of the defining dll, but if you want to export
the said exception and throw outside of the dll, then you need to
export/import from the dll. It seems to me, from having gone back and
read the discussion threads on this topic, that BOOST_SYMBOL_VISIBLE was
sort of a gcc specific addition to enable re-exporting exceptions from gcc
dso's. In the least, I believe that your proposal below should completely
replace BOOST_SYMBOL_VISIBLE, as it takes into account both gcc and msvc.

> So, I propose to have 2 new macroses:
> BOOST_SYMBOL_VISIBLE_EXPORT//export "always" visible symbol from the
> library
> BOOST_SYMBOL_VISIBLE_IMPORT//import "always" visible symbol to the
> library

Mostafa


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk