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)
else # *nix
LIBRARY = $(BLDIR)/lib$(LIBNAME).$(EXT)
CFLAGS += -fvisibility=hidden
endif
endif

@ -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))

Loading…
Cancel
Save