From 1f461ac45bfa8887261510a95fb33a346d68eaba Mon Sep 17 00:00:00 2001 From: aavit Date: Wed, 6 Jun 2012 15:16:49 +0200 Subject: Namespace the bundled zlib symbols, to avoid clash with user zlib When Qt is being compiled and is using the bundled zlib, QtCore needs to export the zlib symbols, since zlib is needed in other Qt libraries as well. That gives a danger of a potentially disastrous symbol clash if the user later on links with both Qt and an external zlib (ref. e.g. QTBUG-15071). This commit enables a zlib compilation flag that causes all zlib symbols to be redefined with a prefix. Hence, they will not clash with a standard zlib. A minor drawback is that zlib.h will now have #defines for a few semi-normal identifiers. Hence, a couple of more changes are done: In the private qzip code, the identifer crc32 had to be renamed. QHttpNetworkReplyPrivate needed no change, but as a defensive measure the #include is moved from the _p.h file to the .cpp file, to avoid surprising compilation errors later in code that include that header. This commit does not in itself solve the issue of how to let Qt libraries outside of qtbase use the same bundled zlib, but it is a prerequisite for that. Change-Id: If84105901a8c90d35009faffe660c85a6bd2fee5 Reviewed-by: Thiago Macieira --- src/3rdparty/zlib/zconf.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/3rdparty/zlib') diff --git a/src/3rdparty/zlib/zconf.h b/src/3rdparty/zlib/zconf.h index 806a51e28c..06e7786cdf 100644 --- a/src/3rdparty/zlib/zconf.h +++ b/src/3rdparty/zlib/zconf.h @@ -8,6 +8,9 @@ #ifndef ZCONF_H #define ZCONF_H +/* Since QtCore must export these symbols, define Z_PREFIX to avoid clashes system zlib */ +#define Z_PREFIX + /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. -- cgit v1.2.3