Re: Detect '-fvisibility=hidden' during pre process or compile time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 22 Apr 2022, Max Sagebaum wrote:

> Hello Alexander,
> 
> thank you for the answer. Unfortunately, the type needs to be a template
> parameter.  Is there any other way to change the visibility of a member or in
> addition change the visibility of a template parameter?

You can change visibility of the type used as the template parameter; in the
small example in the Bugzilla, you could write

struct __attribute__((visibility("default"))) S {
};

or with a pragma:

#pragma GCC visibility push(default)
struct S {
};
#pragma GCC visibility pop

If in your actual library such 'struct S' has many members and you want to avoid
making them default-visibility, you could move some of them into a subobject
(which then may have hidden visibility).

Alexander



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux