From 1cb15eb3049b918c8c1363e874f2efb491cbb534 Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Sun, 8 Aug 2010 15:11:37 +0800 Subject: libpng: use GCC visibility to reduce shared library size The change introduced the implementation for macro PNG_IMPEXP by using GCC visibility in defaulting of "hidden" attribute. Experiment on HTC Passion: target file; out/target/product/passion/system/lib/libskia.so (libpng was statically linked to libskia.so) before: 1117888 bytes after: 1113780 bytes Code size reduction = 4108 bytes Change-Id: I9b718a6a5710268dbb945feea3b64ca3fa393b94 --- pngconf.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pngconf.h') diff --git a/pngconf.h b/pngconf.h index defc16d..5760ba3 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1505,7 +1505,11 @@ typedef z_stream FAR * png_zstreamp; # define PNGAPI #endif #ifndef PNG_IMPEXP -# define PNG_IMPEXP +# if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) +# define PNG_IMPEXP __attribute__((visibility ("default"))) +# else +# define PNG_IMPEXP +# endif #endif #ifdef PNG_BUILDSYMS -- cgit v1.1