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
test2
Hilko Bengen 10 years ago committed by Nguyen Anh Quynh
parent 967e98786a
commit e0352d69d8
  1. 1
      Makefile
  2. 4
      include/capstone.h

@ -290,6 +290,7 @@ else ifeq ($(IS_CYGWIN),1)
LIBRARY = $(BLDIR)/$(LIBNAME).$(EXT) LIBRARY = $(BLDIR)/$(LIBNAME).$(EXT)
else # *nix else # *nix
LIBRARY = $(BLDIR)/lib$(LIBNAME).$(EXT) LIBRARY = $(BLDIR)/lib$(LIBNAME).$(EXT)
CFLAGS += -fvisibility=hidden
endif endif
endif endif

@ -24,8 +24,12 @@ extern "C" {
#define CAPSTONE_EXPORT #define CAPSTONE_EXPORT
#endif #endif
#else #else
#ifdef __GNUC__
#define CAPSTONE_EXPORT __attribute__((visibility("default")))
#else
#define CAPSTONE_EXPORT #define CAPSTONE_EXPORT
#endif #endif
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#define CAPSTONE_DEPRECATED __attribute__((deprecated)) #define CAPSTONE_DEPRECATED __attribute__((deprecated))

Loading…
Cancel
Save