From c81cecf620d506653a1ead83858b8b3fc240abb5 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 1 Nov 2010 22:01:15 -0700 Subject: 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). --- lib/libsha1.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libsha1.h') 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 +#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 -- cgit v1.2.3