From c36a54d063f2ab9161229432947b8009032fcfa6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 18 Jul 2010 01:46:34 +0200 Subject: [PATCH] hide all internal symbols of the library using -fvisibility=hidden --- configure.ac | 2 ++ src/Makefile.am | 2 ++ src/scXp.c | 2 +- src/tcap.h | 5 +++++ src/tcu.c | 6 +++--- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 5436a38..88271c8 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,8 @@ AC_CONFIG_MACRO_DIR([m4]) dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +gl_VISIBILITY + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC diff --git a/src/Makefile.am b/src/Makefile.am index 5b17568..1a20653 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,6 +17,8 @@ libosmo_tcap_la_SOURCES = \ tsl_tco.c \ tsl_tsm.c +libosmo_tcap_la_CFLAGS = $(CFLAG_VISIBILITY) + tcap_test_SOURCES = tcap_test.c tcap_test_LDADD = -losmo-tcap -losmo-asn1-tcap -lm diff --git a/src/scXp.c b/src/scXp.c index ce81e2b..ca2b2fb 100644 --- a/src/scXp.c +++ b/src/scXp.c @@ -67,7 +67,7 @@ static int udp_read_cb(struct bsc_fd *fd) return rc; } -struct tcap_transport_entity *tcap_transp_udp_create(struct sockaddr_storage *local_addr) +LIB_EXPORTED struct tcap_transport_entity *tcap_transp_udp_create(struct sockaddr_storage *local_addr) { struct tcap_transport_entity *tte = talloc_zero(NULL, struct tcap_transport_entity); struct write_queue *wq; diff --git a/src/tcap.h b/src/tcap.h index dac0d89..3cdcec5 100644 --- a/src/tcap.h +++ b/src/tcap.h @@ -14,6 +14,11 @@ #include #include +#if HAVE_VISIBILITY +#define LIB_EXPORTED __attribute__((__visibility__("default"))) +#else +#define LIB_EXPORTED +#endif struct tcap_component { struct llist_head list; diff --git a/src/tcu.c b/src/tcu.c index 0046684..faf2623 100644 --- a/src/tcu.c +++ b/src/tcu.c @@ -32,7 +32,7 @@ static const struct value_string tcap_prim_names[] = { { 0, NULL } }; -const char *tcap_prim_name(enum tcap_primitive prim) +LIB_EXPORTED const char *tcap_prim_name(enum tcap_primitive prim) { return get_value_string(tcap_prim_names, prim); } @@ -135,7 +135,7 @@ int tcap_tcu_result_nl_ind() { } -int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci) +LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci) { struct tcap_dialogue *td; int rc = 0; @@ -175,7 +175,7 @@ int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci return rc; } -int tcap_user_req_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi) +LIB_EXPORTED int tcap_user_req_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi) { struct tcap_dialogue *td; int rc = 0;