chiark / gitweb /
set visibility of functions explicitly to avoid name clashes
authorLennart Poettering <lennart@poettering.net>
Mon, 9 May 2011 13:07:20 +0000 (15:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 9 May 2011 13:07:20 +0000 (15:07 +0200)
configure.ac
netlink.h
nss-myhostname.c

index dcf88155f7e724977011890c08beb8516b8d31d3..6f4dfaf13d0094e6e19de2b47554a4e1cea48c2f 100644 (file)
@@ -44,7 +44,7 @@ AC_PROG_MAKE_SET
 
 # GCC flags
 
-DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math"
+DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math -fvisibility=hidden -fdiagnostics-show-option"
 
 for flag in $DESIRED_FLAGS ; do
   CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
index e6ad59bf45ece00b95b865f01d93e33c3f45f221..4f0024851ab7b5685a576cc960d0d144d81a5632 100644 (file)
--- a/netlink.h
+++ b/netlink.h
@@ -34,7 +34,10 @@ struct address {
         int ifindex;
 };
 
-int netlink_acquire_addresses(struct address **_list, unsigned *_n_list);
+#define _public_ __attribute__ ((visibility("default")))
+#define _hidden_ __attribute__ ((visibility("hidden")))
+
+int netlink_acquire_addresses(struct address **_list, unsigned *_n_list) _hidden_;
 
 static inline size_t PROTO_ADDRESS_SIZE(int proto) {
         assert(proto == AF_INET || proto == AF_INET6);
index b091fba35d04aa5299487826bcd74221998dcc07..293166c49106870cb6cd9ce77535861346ba4a4f 100644 (file)
@@ -50,7 +50,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
                 struct gaih_addrtuple **pat,
                 char *buffer, size_t buflen,
                 int *errnop, int *h_errnop,
-                int32_t *ttlp);
+                int32_t *ttlp) _public_;
 
 enum nss_status _nss_myhostname_gethostbyname3_r(
                 const char *name,
@@ -59,20 +59,20 @@ enum nss_status _nss_myhostname_gethostbyname3_r(
                 char *buffer, size_t buflen,
                 int *errnop, int *h_errnop,
                 int32_t *ttlp,
-                char **canonp);
+                char **canonp) _public_;
 
 enum nss_status _nss_myhostname_gethostbyname2_r(
                 const char *name,
                 int af,
                 struct hostent *host,
                 char *buffer, size_t buflen,
-                int *errnop, int *h_errnop);
+                int *errnop, int *h_errnop) _public_;
 
 enum nss_status _nss_myhostname_gethostbyname_r(
                 const char *name,
                 struct hostent *host,
                 char *buffer, size_t buflen,
-                int *errnop, int *h_errnop);
+                int *errnop, int *h_errnop) _public_;
 
 enum nss_status _nss_myhostname_gethostbyaddr2_r(
                 const void* addr, socklen_t len,
@@ -80,14 +80,14 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r(
                 struct hostent *host,
                 char *buffer, size_t buflen,
                 int *errnop, int *h_errnop,
-                int32_t *ttlp);
+                int32_t *ttlp) _public_;
 
 enum nss_status _nss_myhostname_gethostbyaddr_r(
                 const void* addr, socklen_t len,
                 int af,
                 struct hostent *host,
                 char *buffer, size_t buflen,
-                int *errnop, int *h_errnop);
+                int *errnop, int *h_errnop) _public_;
 
 enum nss_status _nss_myhostname_gethostbyname4_r(
                 const char *name,