Hello,the documentation of the module lib-symbo-visibility, http://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html, recommends defining macro LIBFOO_DLL_EXPORTED, which shall be enabled in all public header files, and annotating all variable, function and class declarations in all public header files of the library with LIBFOO_DLL_EXPORTED.
I would instead leave the public header files as they are, and annotate instead all the variable, function and class definitions (not declarations) with LIBFOO_DLL_EXPORTED. This leads to public header files, which do not mention LIBFOO_DLL_EXPORTED, and are thus smaller and easier to read. My preference is to put in configure.ac
gl_VISIBILITY AH_BOTTOM([#if HAVE_VISIBILITY #define EXPORTED __attribute__((__visibility__("default"))) #define HIDDEN __attribute__((__visibility__("hidden"))) #else #define EXPORTED #define HIDDEN #endif])which leads to defining properly EXPORTED and HIDDEN in config.h and all .c files #including config.h can make effective use of the EXPORTED/HIDDEN annotations.
Defining LIBFOO_DLL_EXPORTED in public header files has no added value from the user's perspective: mentioning a function in the public header files implies, that the function is visible. As suggested, there is another way to achieve the same result, without touching the header files.
Със здраве Дилян
<<attachment: dilyan_palauzov.vcf>>