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) |