summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qzip.cpp
diff options
context:
space:
mode:
authoraavit <qt_aavit@ovi.com>2012-06-06 15:16:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-08 00:53:10 +0200
commit1f461ac45bfa8887261510a95fb33a346d68eaba (patch)
tree031911dd37be3545f1243e84b5dbc101c7294f79 /src/gui/text/qzip.cpp
parent02191b6e4b03fe05b1b953b3e5d5e456cc5817c9 (diff)
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 <zlib.h> 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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/text/qzip.cpp')
-rw-r--r--src/gui/text/qzip.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index e9ff5e8b59..e3c20f078e 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -358,7 +358,7 @@ struct FileHeader
};
QZipReader::FileInfo::FileInfo()
- : isDir(false), isFile(false), isSymLink(false), crc32(0), size(0)
+ : isDir(false), isFile(false), isSymLink(false), crc(0), size(0)
{
}
@@ -378,7 +378,7 @@ QZipReader::FileInfo& QZipReader::FileInfo::operator=(const FileInfo &other)
isFile = other.isFile;
isSymLink = other.isSymLink;
permissions = other.permissions;
- crc32 = other.crc32;
+ crc = other.crc;
size = other.size;
lastModified = other.lastModified;
return *this;
@@ -424,7 +424,7 @@ void QZipPrivate::fillFileInfo(int index, QZipReader::FileInfo &fileInfo) const
fileInfo.isFile = S_ISREG(mode);
fileInfo.isSymLink = S_ISLNK(mode);
fileInfo.permissions = modeToPermissions(mode);
- fileInfo.crc32 = readUInt(header.h.crc_32);
+ fileInfo.crc = readUInt(header.h.crc_32);
fileInfo.size = readUInt(header.h.uncompressed_size);
fileInfo.lastModified = readMSDosDate(header.h.last_mod_file);
}
@@ -701,8 +701,8 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const
*/
/*!
- \variable FileInfo::crc32
- The calculated checksum as a crc32 type.
+ \variable FileInfo::crc
+ The calculated checksum as a crc type.
*/
/*!