Description: Limit exported symbols
 Make sure that only symbols that are part of the API are exported by
 the library -- similar to __declspec(dllexport) for the MSVC
 compiler. This makes it possible to use dpkg-gensymbols.
Author: Hilko Bengen <bengen@debian.org>
Forwarded: no
Last-Update: 2015-02-25

--- a/Makefile
+++ b/Makefile
@@ -290,6 +290,7 @@ else ifeq ($(IS_CYGWIN),1)
 LIBRARY = $(BLDIR)/$(LIBNAME).$(EXT)
 else	# *nix
 LIBRARY = $(BLDIR)/lib$(LIBNAME).$(EXT)
+CFLAGS += -fvisibility=hidden
 endif
 endif
 
--- a/include/capstone.h
+++ b/include/capstone.h
@@ -24,8 +24,12 @@ extern "C" {
 #define CAPSTONE_EXPORT
 #endif
 #else
+#ifdef __GNUC__
+#define CAPSTONE_EXPORT __attribute__((visibility("default")))
+#else
 #define CAPSTONE_EXPORT
 #endif
+#endif
 
 #ifdef __GNUC__
 #define CAPSTONE_DEPRECATED __attribute__((deprecated))
