[Zlib-devel] zlib 1.2.4.4 -- a 1.2.5 release candidate

Cosmin Truta cosmin at cs.toronto.edu
Sun Apr 18 11:43:43 EDT 2010


On Sun, Apr 18, 2010 at 11:36 AM, Cosmin Truta wrote:
> The original code is incorrect because it places a non-standard gcc-4
> extension in plain sight. I am providing the fix below.

Actually, I found out that this attribute works not only on gcc-4, but
also on gcc-3.3 and gcc-3.4.
http://www.ohse.de/uwe/articles/gcc-attributes.html#func-visibility

--- zconf.h~    Sun Apr 18 03:51:32 2010
+++ zconf.h     Sun Apr 18 11:42:00 2010
@@ -316,7 +316,9 @@
 #endif

 #ifndef NO_VIZ
-#  define ZEXTERN __attribute__((visibility ("default"))) extern
+#  if defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 33)
+#    define ZEXTERN __attribute__((visibility ("default"))) extern
+#  endif
 #endif

 #ifndef ZEXTERN




More information about the Zlib-devel mailing list