Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: third_party/zlib/contrib/minizip/miniunz.c

Issue 2079313002: Revert of Update Zlib to version 1.2.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/zlib/contrib/minizip/iowin32.c ('k') | third_party/zlib/contrib/minizip/minizip.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/zlib/contrib/minizip/miniunz.c
diff --git a/third_party/zlib/contrib/minizip/miniunz.c b/third_party/zlib/contrib/minizip/miniunz.c
index 3d65401be5cdd7b58c57d681e28347278942917b..9ed009fbd9947b39212123c072c489983079dc36 100644
--- a/third_party/zlib/contrib/minizip/miniunz.c
+++ b/third_party/zlib/contrib/minizip/miniunz.c
@@ -12,7 +12,7 @@
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
*/
-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
+#ifndef _WIN32
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
#endif
@@ -27,18 +27,6 @@
#endif
#endif
-#ifdef __APPLE__
-// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
-#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
-#define FTELLO_FUNC(stream) ftello(stream)
-#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
-#else
-#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
-#define FTELLO_FUNC(stream) ftello64(stream)
-#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
-#endif
-
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -46,14 +34,13 @@
#include <errno.h>
#include <fcntl.h>
-#ifdef _WIN32
+#ifdef unix
+# include <unistd.h>
+# include <utime.h>
+#else
# include <direct.h>
# include <io.h>
-#else
-# include <unistd.h>
-# include <utime.h>
-#endif
-
+#endif
#include "unzip.h"
@@ -97,7 +84,7 @@
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
CloseHandle(hFile);
#else
-#ifdef unix || __APPLE__
+#ifdef unix
struct utimbuf ut;
struct tm newdate;
newdate.tm_sec = tmu_date.tm_sec;
@@ -127,10 +114,10 @@
int ret=0;
#ifdef _WIN32
ret = _mkdir(dirname);
-#elif unix
+#else
+#ifdef unix
ret = mkdir (dirname,0775);
-#elif __APPLE__
- ret = mkdir (dirname,0775);
+#endif
#endif
return ret;
}
@@ -377,7 +364,7 @@
{
char rep=0;
FILE* ftestexist;
- ftestexist = FOPEN_FUNC(write_filename,"rb");
+ ftestexist = fopen64(write_filename,"rb");
if (ftestexist!=NULL)
{
fclose(ftestexist);
@@ -408,7 +395,8 @@
if ((skip==0) && (err==UNZ_OK))
{
- fout=FOPEN_FUNC(write_filename,"wb");
+ fout=fopen64(write_filename,"wb");
+
/* some zipfile don't contain directory alone before file */
if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
(filename_withoutpath!=(char*)filename_inzip))
@@ -417,7 +405,7 @@
*(filename_withoutpath-1)='\0';
makedir(write_filename);
*(filename_withoutpath-1)=c;
- fout=FOPEN_FUNC(write_filename,"wb");
+ fout=fopen64(write_filename,"wb");
}
if (fout==NULL)
« no previous file with comments | « third_party/zlib/contrib/minizip/iowin32.c ('k') | third_party/zlib/contrib/minizip/minizip.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698