This is a preprocessor macro. And is defined as:
#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY #define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) #else #define _GLIBCXX_VISIBILITY(V) #endif
So, if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY true, then in your case it will expand to:
__attribute__ (( __visibility__ ("default")))
else if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY false, it will not do anything.
The __visibility__ attribute __visibility__ used to determine the visibility of characters in a DSO file. Using "hidden" instead of "default" can be used to hide characters from objects outside of DSO.
For instance:
__attribute__ ((__visibility__("default"))) void foo(); __attribute__ ((__visibility__("hidden"))) void bar();
The foo() function will be used from outside the DSO, while bar() is mostly private and can only be used inside DSO.
You can read a little more about the __visibility__ attribute here: https://gcc.gnu.org/wiki/Visibility
source share