diff options
author | Carl Worth <cworth@cworth.org> | 2010-11-01 22:01:15 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-11-01 22:35:48 -0700 |
commit | c81cecf620d506653a1ead83858b8b3fc240abb5 (patch) | |
tree | f69fd387af5c9c28637f6f4f2fa0253df0be9571 /lib | |
parent | 67c3bc9db48c9e12d648df4792c706cae723676c (diff) |
lib: Add GCC visibility(hidden) pragmas to private header files.
This prevents any of the private functions from being leaked out
through the library interface (at least when compiling with a
recent-enough gcc to support the visibility pragma).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/database-private.h | 4 | ||||
-rw-r--r-- | lib/libsha1.h | 4 | ||||
-rw-r--r-- | lib/notmuch-private.h | 4 | ||||
-rw-r--r-- | lib/xutil.h | 4 |
4 files changed, 16 insertions, 0 deletions
diff --git a/lib/database-private.h b/lib/database-private.h index bd72f67..e42b8bb 100644 --- a/lib/database-private.h +++ b/lib/database-private.h @@ -34,6 +34,8 @@ #include <xapian.h> +#pragma GCC visibility push(hidden) + struct _notmuch_database { notmuch_bool_t exception_reported; @@ -65,4 +67,6 @@ notmuch_tags_t * _notmuch_convert_tags (void *ctx, Xapian::TermIterator &i, Xapian::TermIterator &end); +#pragma GCC visibility pop + #endif diff --git a/lib/libsha1.h b/lib/libsha1.h index b4dca93..c1c848f 100644 --- a/lib/libsha1.h +++ b/lib/libsha1.h @@ -43,6 +43,8 @@ extern "C" #include <stdint.h> +#pragma GCC visibility push(hidden) + /* Size of SHA1 digest */ #define SHA1_DIGEST_SIZE 20 @@ -60,6 +62,8 @@ void sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]); void sha1_end(unsigned char hval[], sha1_ctx ctx[1]); void sha1(unsigned char hval[], const unsigned char data[], unsigned long len); +#pragma GCC visibility pop + #if defined(__cplusplus) } #endif diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 5a0cf92..5b32f84 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -48,6 +48,8 @@ NOTMUCH_BEGIN_DECLS #include "xutil.h" +#pragma GCC visibility push(hidden) + #ifdef DEBUG # define DEBUG_DATABASE_SANITY 1 # define DEBUG_QUERY 1 @@ -442,6 +444,8 @@ _notmuch_tags_add_tag (notmuch_tags_t *tags, const char *tag); void _notmuch_tags_prepare_iterator (notmuch_tags_t *tags); +#pragma GCC visibility pop + NOTMUCH_END_DECLS #endif diff --git a/lib/xutil.h b/lib/xutil.h index b973f7d..fd77f73 100644 --- a/lib/xutil.h +++ b/lib/xutil.h @@ -25,6 +25,8 @@ #include <sys/types.h> #include <regex.h> +#pragma GCC visibility push(hidden) + /* xutil.c */ void * xcalloc (size_t nmemb, size_t size); @@ -48,4 +50,6 @@ int xregexec (const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags); +#pragma GCC visibility pop + #endif |