gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: Libstdc++ as DLL on windows, alternative approach [was Re: cygwin p

Subject: Re: Libstdc++ as DLL on windows, alternative approach [was Re: cygwin patch review]
From: Dave Korn
Date: Mon, 16 Nov 2009 03:49:12 +0000
Danny Smith wrote:
> On Fri, Nov 13, 2009 at 11:40 AM, Dave Korn  wrote:
>> Benjamin Kosnik wrote:
>>> From older mail thread:
>>  Likewise.  I had to take some time away from this to do other stuff, but
>> I've gotten back to it this week.
>>
>>> No. There is already visibility markup on libstdc++ headers for this.
>>> You can just put the attribute visibility bits on namespace std, and be
>>> done with it.
>>>
>>> Here, from include/bits/c++config.h:
>>>
>>> # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X
>>> _GLIBCXX_VISIBILITY_ATTR(default)
> <snip>
>>        * libstdc++-v3/include/bits/c++config (_GLIBCXX_VISIBILITY_ATTR): On
>>        platforms that don't support visibility, allow them to declare a macro
>>        _GLIBCXX_PSEUDO_VISIBILITY that is applied in place of visibility.
>>
> 
> I like the idea but the name _GLIBCXX_PSEUDO_VISIBILITY is a bit
> strange to me (and probably others with psuedo-dyslexia).
> Why not _GLIBCXX_TARGET_VISIBILITY_ATTR or (more generically)
> _GLIBCXX_TARGET_ACCESSIBILITY_ATTR that defaults to
> _GLIBCXX_VISIBILITY_ATTR.

  Well, the rationale is "because it's not visibility, but it's something that
stands in its place".  So, I chose "pseudo"-visibility because it's not
visibility but it's like visibility.

  I don't mind renaming it, but not to anything like TARGET_VISIBILITY please,
because it just isn't visibility.  It's not really even accessibility either,
because after all those functions are just as 'accessible' at link time
regardless of whether they were marked up as _dllimport or not at compiletime,
it only changes whether they'll need to be auto-imported or not.  What it
really is is "An arbitrary tag of any kind at all, that can be applied to the
namespaces in the C++ library, differently according to whether or not those
namespaces are intended to be visible or not, but it doesn't actually
necessarily have to do visibility stuff to those namespaces in practice,
particularly on platforms that don't support visibility".

  Got a third suggestion?


    cheers,
      DaveK

<Prev in Thread] Current Thread [Next in Thread>