Commit 4f9339df by Pierre Habouzit Committed by Shawn O. Pearce

Hide non-exported symbols when linking the library

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
parent 06160502
...@@ -6,6 +6,7 @@ CFLAGS = -g -O2 ...@@ -6,6 +6,7 @@ CFLAGS = -g -O2
BASIC_CFLAGS := -Isrc BASIC_CFLAGS := -Isrc
BASIC_CFLAGS += -DGIT__PRIVATE BASIC_CFLAGS += -DGIT__PRIVATE
BASIC_CFLAGS += -fvisibility=hidden
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
HDRS = $(wildcard src/*.h) HDRS = $(wildcard src/*.h)
......
...@@ -56,7 +56,11 @@ ...@@ -56,7 +56,11 @@
GIT_BEGIN_DECL GIT_BEGIN_DECL
/** Declare a public function exported for application use. */ /** 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. */ /** Generic result code for any API call. */
typedef int git_result_t; typedef int git_result_t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment