summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 00:06:47 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 00:06:47 +0000
commit98e72142d06252169a27570cf448639889c66dc6 (patch)
tree2034dcd9b77495f7d2f9f36fc9801b9365c6e740 /third_party
parentca35f85329122c44b55c97ffb99caac7fcff818d (diff)
downloadchromium_src-98e72142d06252169a27570cf448639889c66dc6.zip
chromium_src-98e72142d06252169a27570cf448639889c66dc6.tar.gz
chromium_src-98e72142d06252169a27570cf448639889c66dc6.tar.bz2
Add zlib unzip to mac build and enable unit test.
To get it to build, the source files had to have a few minor modifications: - resolved compiler warnings - fixed include path to avoid picking up system version of header Review URL: http://codereview.chromium.org/19645 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/zlib/contrib/minizip/ioapi.c4
-rw-r--r--third_party/zlib/contrib/minizip/unzip.c18
-rw-r--r--third_party/zlib/zlib.xcodeproj/project.pbxproj22
3 files changed, 37 insertions, 7 deletions
diff --git a/third_party/zlib/contrib/minizip/ioapi.c b/third_party/zlib/contrib/minizip/ioapi.c
index f1bee23..3916d04 100644
--- a/third_party/zlib/contrib/minizip/ioapi.c
+++ b/third_party/zlib/contrib/minizip/ioapi.c
@@ -10,7 +10,9 @@
#include <stdlib.h>
#include <string.h>
-#include "zlib.h"
+/* NOTE(erikkay): this modification was needed to avoid picking up the system
+ version of zlib.h on the Mac */
+#include "third_party/zlib/zlib.h"
#include "ioapi.h"
diff --git a/third_party/zlib/contrib/minizip/unzip.c b/third_party/zlib/contrib/minizip/unzip.c
index 9ad4766d..72d88f2 100644
--- a/third_party/zlib/contrib/minizip/unzip.c
+++ b/third_party/zlib/contrib/minizip/unzip.c
@@ -38,7 +38,9 @@ woven in by Terry Thorsen 1/2003.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "zlib.h"
+/* NOTE(erikkay): this modification was needed to avoid picking up the system
+ version of zlib.h on the Mac */
+#include "third_party/zlib/zlib.h"
#include "unzip.h"
#ifdef STDC
@@ -607,11 +609,12 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
/* we check the magic */
- if (err==UNZ_OK)
+ if (err==UNZ_OK) {
if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
err=UNZ_ERRNO;
else if (uMagic!=0x02014b50)
err=UNZ_BADZIPFILE;
+ }
if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
err=UNZ_ERRNO;
@@ -687,11 +690,12 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
else
uSizeRead = extraFieldBufferSize;
- if (lSeek!=0)
+ if (lSeek!=0) {
if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
lSeek=0;
else
err=UNZ_ERRNO;
+ }
if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead)
err=UNZ_ERRNO;
@@ -712,11 +716,12 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
else
uSizeRead = commentBufferSize;
- if (lSeek!=0)
+ if (lSeek!=0) {
if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
lSeek=0;
else
err=UNZ_ERRNO;
+ }
if ((file_info.size_file_comment>0) && (commentBufferSize>0))
if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
err=UNZ_ERRNO;
@@ -976,11 +981,12 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
return UNZ_ERRNO;
- if (err==UNZ_OK)
+ if (err==UNZ_OK) {
if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
err=UNZ_ERRNO;
else if (uMagic!=0x04034b50)
err=UNZ_BADZIPFILE;
+ }
if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
err=UNZ_ERRNO;
@@ -1534,7 +1540,7 @@ extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
char *szComment;
uLong uSizeBuf;
{
- int err=UNZ_OK;
+ //int err=UNZ_OK;
unz_s* s;
uLong uReadThis ;
if (file==NULL)
diff --git a/third_party/zlib/zlib.xcodeproj/project.pbxproj b/third_party/zlib/zlib.xcodeproj/project.pbxproj
index 963b3d4..2394fd0 100644
--- a/third_party/zlib/zlib.xcodeproj/project.pbxproj
+++ b/third_party/zlib/zlib.xcodeproj/project.pbxproj
@@ -19,6 +19,8 @@
82AB5D930D8044BE005B920B /* trees.c in Sources */ = {isa = PBXBuildFile; fileRef = 82AB5D7C0D8044BE005B920B /* trees.c */; };
82AB5D950D8044BE005B920B /* uncompr.c in Sources */ = {isa = PBXBuildFile; fileRef = 82AB5D7E0D8044BE005B920B /* uncompr.c */; };
82AB5D980D8044BE005B920B /* zutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 82AB5D810D8044BE005B920B /* zutil.c */; };
+ A57282C70F31209800384E1B /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = A57282C50F31209800384E1B /* ioapi.c */; };
+ A57282CA0F3120AE00384E1B /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = A57282C80F3120AE00384E1B /* unzip.c */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -50,6 +52,10 @@
82AB5D800D8044BE005B920B /* zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zlib.h; sourceTree = "<group>"; };
82AB5D810D8044BE005B920B /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zutil.c; sourceTree = "<group>"; };
82AB5D820D8044BE005B920B /* zutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zutil.h; sourceTree = "<group>"; };
+ A57282C50F31209800384E1B /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = contrib/minizip/ioapi.c; sourceTree = "<group>"; };
+ A57282C60F31209800384E1B /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = contrib/minizip/ioapi.h; sourceTree = "<group>"; };
+ A57282C80F3120AE00384E1B /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unzip.c; path = contrib/minizip/unzip.c; sourceTree = "<group>"; };
+ A57282C90F3120AE00384E1B /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unzip.h; path = contrib/minizip/unzip.h; sourceTree = "<group>"; };
D2AAC046055464E500DB518D /* libzlib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libzlib.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -77,6 +83,7 @@
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
+ A57282C40F31208700384E1B /* minizip */,
82AB5D6C0D8044BE005B920B /* adler32.c */,
82AB5D6D0D8044BE005B920B /* compress.c */,
82AB5D6E0D8044BE005B920B /* crc32.c */,
@@ -125,6 +132,17 @@
path = ../../build;
sourceTree = "<group>";
};
+ A57282C40F31208700384E1B /* minizip */ = {
+ isa = PBXGroup;
+ children = (
+ A57282C80F3120AE00384E1B /* unzip.c */,
+ A57282C90F3120AE00384E1B /* unzip.h */,
+ A57282C50F31209800384E1B /* ioapi.c */,
+ A57282C60F31209800384E1B /* ioapi.h */,
+ );
+ name = minizip;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -178,6 +196,8 @@
82AB5D930D8044BE005B920B /* trees.c in Sources */,
82AB5D950D8044BE005B920B /* uncompr.c in Sources */,
82AB5D980D8044BE005B920B /* zutil.c in Sources */,
+ A57282C70F31209800384E1B /* ioapi.c in Sources */,
+ A57282CA0F3120AE00384E1B /* unzip.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -188,6 +208,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7BA016410E5A1E0700044150 /* staticlib.xcconfig */;
buildSettings = {
+ HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../..\"";
PRODUCT_NAME = zlib;
};
name = Debug;
@@ -196,6 +217,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7BA016410E5A1E0700044150 /* staticlib.xcconfig */;
buildSettings = {
+ HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../..\"";
PRODUCT_NAME = zlib;
};
name = Release;