Set default visibility of symbols to "hidden"

This causes symbols not to be exported from the library
unless they are explicitly marked by NN_EXPORT.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c2c1f71..c21cffe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -191,6 +191,12 @@
     transports/tcp/tcp.c
 )
 
+#  Here we cause symbols not to be exported from the library unless
+#  they are explicitly marked by NN_EXPORT specifier.
+if (CMAKE_COMPILER_IS_GNUCC)
+    add_definitions (-fvisibility=hidden)
+endif ()
+
 add_library (nanomsg SHARED ${NN_SOURCES})
 set_target_properties (nanomsg PROPERTIES VERSION "${NN_VERSION_STR}")
 
diff --git a/tests/hash.c b/tests/hash.c
index acd70d7..ce5c3de 100644
--- a/tests/hash.c
+++ b/tests/hash.c
@@ -21,6 +21,7 @@
 */
 
 #include "../src/utils/err.c"
+#include "../src/utils/list.c"
 #include "../src/utils/hash.c"
 #include "../src/utils/alloc.c"