Build ZLIB with fvisibility=hidden on Linux
There is a macro ZEXPORT which as I understand should set appropriate visibility for functions that should be accessed from outside. But for Linux definition of ZEXPORT is empty so when I set fvisibility=hidden the functions become invisible
You can build with your own ZEXPORT MACRO if you set fvisibility=hidden globally.
But why you set fvisibility=hidden ?
Oh, thank you, didn't think about the possibility of defining own ZEXPORT. Thank you! I use fvisibility=hidden because according to https://gcc.gnu.org/wiki/Visibility this can significantly influence the size of the executable, compilation time, etc.
ZEXPORT for some reason is placed in the middle of function declarations and definitions instead of at the beginning, which causes compiler to spit warnings and sometimes to ignore attribute.