| Index: third_party/zlib/contrib/minizip/minizip.c
|
| diff --git a/third_party/zlib/contrib/minizip/minizip.c b/third_party/zlib/contrib/minizip/minizip.c
|
| index 4288962ecef05681db4c62bfa13b2f090b9ce6a8..7a4fa5a643ebf9ca484cc0654eb10071d16ea885 100644
|
| --- a/third_party/zlib/contrib/minizip/minizip.c
|
| +++ b/third_party/zlib/contrib/minizip/minizip.c
|
| @@ -13,7 +13,7 @@
|
| */
|
|
|
|
|
| -#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
|
| +#ifndef _WIN32
|
| #ifndef __USE_FILE_OFFSET64
|
| #define __USE_FILE_OFFSET64
|
| #endif
|
| @@ -28,19 +28,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>
|
| @@ -48,14 +35,14 @@
|
| #include <errno.h>
|
| #include <fcntl.h>
|
|
|
| -#ifdef _WIN32
|
| -# include <direct.h>
|
| -# include <io.h>
|
| -#else
|
| +#ifdef unix
|
| # include <unistd.h>
|
| # include <utime.h>
|
| # include <sys/types.h>
|
| # include <sys/stat.h>
|
| +#else
|
| +# include <direct.h>
|
| +# include <io.h>
|
| #endif
|
|
|
| #include "zip.h"
|
| @@ -94,7 +81,7 @@
|
| return ret;
|
| }
|
| #else
|
| -#ifdef unix || __APPLE__
|
| +#ifdef unix
|
| uLong filetime(f, tmzip, dt)
|
| char *f; /* name of file to get info on */
|
| tm_zip *tmzip; /* return value: access, modific. and creation times */
|
| @@ -155,7 +142,7 @@
|
| {
|
| FILE* ftestexist;
|
| int ret = 1;
|
| - ftestexist = FOPEN_FUNC(filename,"rb");
|
| + ftestexist = fopen64(filename,"rb");
|
| if (ftestexist==NULL)
|
| ret = 0;
|
| else
|
| @@ -186,8 +173,7 @@
|
| {
|
| unsigned long calculate_crc=0;
|
| int err=ZIP_OK;
|
| - FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
|
| -
|
| + FILE * fin = fopen64(filenameinzip,"rb");
|
| unsigned long size_read = 0;
|
| unsigned long total_read = 0;
|
| if (fin==NULL)
|
| @@ -225,12 +211,13 @@
|
| {
|
| int largeFile = 0;
|
| ZPOS64_T pos = 0;
|
| - FILE* pFile = FOPEN_FUNC(filename, "rb");
|
| + FILE* pFile = fopen64(filename, "rb");
|
|
|
| if(pFile != NULL)
|
| {
|
| - int n = FSEEKO_FUNC(pFile, 0, SEEK_END);
|
| - pos = FTELLO_FUNC(pFile);
|
| + int n = fseeko64(pFile, 0, SEEK_END);
|
| +
|
| + pos = ftello64(pFile);
|
|
|
| printf("File : %s is %lld bytes\n", filename, pos);
|
|
|
| @@ -460,7 +447,7 @@
|
| printf("error in opening %s in zipfile\n",filenameinzip);
|
| else
|
| {
|
| - fin = FOPEN_FUNC(filenameinzip,"rb");
|
| + fin = fopen64(filenameinzip,"rb");
|
| if (fin==NULL)
|
| {
|
| err=ZIP_ERRNO;
|
|
|