Hide non-exported symbols when linking the library

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Pierre Habouzit 2008-10-31 15:10:51 -07:00 committed by Shawn O. Pearce
parent 061605020c
commit 4f9339df94
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ CFLAGS = -g -O2
BASIC_CFLAGS := -Isrc
BASIC_CFLAGS += -DGIT__PRIVATE
BASIC_CFLAGS += -fvisibility=hidden
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
HDRS = $(wildcard src/*.h)

View File

@ -56,7 +56,11 @@
GIT_BEGIN_DECL
/** Declare a public function exported for application use. */
#define GIT_EXTERN(type) type
#ifdef __GNUC__
# define GIT_EXTERN(type) __attribute__((visibility("default"))) type
#else
# define GIT_EXTERN(type) type
#endif
/** Generic result code for any API call. */
typedef int git_result_t;