[FFmpeg-devel] Visibility implementation

Diego Biurrun diego
Thu Oct 23 22:14:31 CEST 2008


On Sun, Oct 19, 2008 at 01:48:10PM +0100, M?ns Rullg?rd wrote:
> Diego Biurrun <diego at biurrun.de> writes:
> 
> > On Sat, Oct 18, 2008 at 11:57:17AM +0100, M?ns Rullg?rd wrote:
> >> Diego Biurrun <diego at biurrun.de> writes:
> >> 
> >> > On Thu, Jul 31, 2008 at 08:03:50PM +0300, Uoti Urpala wrote:
> >> >> On Wed, 2008-07-30 at 05:45 +0300, Uoti Urpala wrote:
> >> >> > The attached patch adds visibility information for lots of symbols in
> >> >> 
> >> >> I created a new version that adds visibility information for most
> >> >> libavcodec symbols. This time I split the patch into two parts. The
> >> >> first one has the repeated changes per internal header marking them as
> >> >> such. The second adds visibility information for some of the symbols
> >> >> that are not static but not declared in any header either, adds
> >> >> exceptions for some symbols which are declared in libavcodec headers but
> >> >> used outside it (mainly in libavformat), and defines the macros used.
> >> >
> >> > Here is a new version of those patches, updated for HEAD.  Uoti, maybe
> >> > you can doublecheck nothing is missing...
> >> >
> >> > --- a/libavutil/internal.h
> >> > +++ b/libavutil/internal.h
> >> > @@ -50,6 +50,12 @@
> >> >  
> >> > +#define START_HIDDEN_VISIBILITY_SECTION _Pragma("GCC visibility push(hidden)")
> >> > +#define END_VISIBILITY_SECTION          _Pragma("GCC visibility pop")
> >> > +
> >> > +#define HIDDEN             __attribute__((visibility("hidden")))
> >> > +#define EXTERNALLY_VISIBLE __attribute__((visibility("default")))
> >> 
> >> These should be under appropriate ifdefs.  The names are awfully long
> >> too.
> >
> > START_HIDDEN_VISIBILITY
> > END_HIDDEN_VISIBILITY
> 
> What about this:
> 
> +#define START_HIDDEN _Pragma("GCC visibility push(hidden)")
> +#define END_HIDDEN   _Pragma("GCC visibility pop")
> +
> +#define HIDDEN  __attribute__((visibility("hidden")))
> +#define VISIBLE __attribute__((visibility("default")))
> 
> Just because a feature was designed to work around C++ bloat, we don't
> have to adopt their bloated naming style when we use it.

Updated version attached.

Diego
-------------- next part --------------
A non-text attachment was scrubbed...
Name: visibility.diff
Type: text/x-diff
Size: 41477 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081023/4ad70129/attachment.diff>



More information about the ffmpeg-devel mailing list