diff options
| author | Pierre Habouzit <madcoder@debian.org> | 2008-10-31 15:10:51 -0700 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-31 15:10:51 -0700 |
| commit | 4f9339df943c53117a5fc8e86e2f38716ff3a668 (patch) | |
| tree | 03a9cba35dd9060f15a7309b438afaa246e80d5c | |
| parent | 061605020c8f212d696a2a3d28e20c7091c09443 (diff) | |
| download | libgit2-4f9339df943c53117a5fc8e86e2f38716ff3a668.tar.gz | |
Hide non-exported symbols when linking the library
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | src/git_common.h | 6 |
2 files changed, 6 insertions, 1 deletions
@@ -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) diff --git a/src/git_common.h b/src/git_common.h index 6e19d89f3..6d8e93b83 100644 --- a/src/git_common.h +++ b/src/git_common.h @@ -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; |
