diff options
author | dartraiden <wowemuh@gmail.com> | 2017-05-15 20:43:40 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-05-15 21:00:34 +0300 |
commit | cea8ae30236ffae064576720537c1952de21450e (patch) | |
tree | 8dfbcdf4133a653534f162041dd6d4789f783b73 /libs/zlib | |
parent | 738ea8d4ababc946b4cd4609f962108bfedc1e79 (diff) |
zlib: merge Miranda-specific fixes
Diffstat (limited to 'libs/zlib')
-rw-r--r-- | libs/zlib/res/zlib.rc | 2 | ||||
-rw-r--r-- | libs/zlib/src/ioapi.c | 26 | ||||
-rw-r--r-- | libs/zlib/src/ioapi.h | 2 | ||||
-rw-r--r-- | libs/zlib/src/iowin32.c | 4 | ||||
-rw-r--r-- | libs/zlib/src/zlib.def | 21 | ||||
-rw-r--r-- | libs/zlib/src/zlib.h | 10 | ||||
-rw-r--r-- | libs/zlib/src/zutil.c | 8 |
7 files changed, 47 insertions, 26 deletions
diff --git a/libs/zlib/res/zlib.rc b/libs/zlib/res/zlib.rc index 234e641c32..8373f88bc4 100644 --- a/libs/zlib/res/zlib.rc +++ b/libs/zlib/res/zlib.rc @@ -1,5 +1,5 @@ #include <winver.h> -#include "../zlib.h" +#include "..\src\zlib.h" #ifdef GCC_WINDRES VS_VERSION_INFO VERSIONINFO diff --git a/libs/zlib/src/ioapi.c b/libs/zlib/src/ioapi.c index 7f5c191b2a..cf0118907e 100644 --- a/libs/zlib/src/ioapi.c +++ b/libs/zlib/src/ioapi.c @@ -34,7 +34,7 @@ voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); else { - return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); + return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const wchar_t*)filename,mode); } } @@ -84,7 +84,7 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef -static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); +static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const wchar_t* filename, int mode)); static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); @@ -92,39 +92,39 @@ static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPO static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); -static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) +static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const wchar_t* filename, int mode) { FILE* file = NULL; - const char* mode_fopen = NULL; + const wchar_t* mode_fopen = NULL; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; + mode_fopen = L"rb"; else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; + mode_fopen = L"r+b"; else if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; + mode_fopen = L"wb"; if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); + file = _wfopen(filename, mode_fopen); return file; } static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) { FILE* file = NULL; - const char* mode_fopen = NULL; + const wchar_t* mode_fopen = NULL; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; + mode_fopen = L"rb"; else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; + mode_fopen = L"r+b"; else if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; + mode_fopen = L"wb"; if ((filename!=NULL) && (mode_fopen != NULL)) - file = FOPEN_FUNC((const char*)filename, mode_fopen); + file = _wfopen((const wchar_t*)filename, mode_fopen); return file; } diff --git a/libs/zlib/src/ioapi.h b/libs/zlib/src/ioapi.h index 8dcbdb06e3..de8c74a685 100644 --- a/libs/zlib/src/ioapi.h +++ b/libs/zlib/src/ioapi.h @@ -132,7 +132,7 @@ extern "C" { -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const wchar_t* filename, int mode)); typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); diff --git a/libs/zlib/src/iowin32.c b/libs/zlib/src/iowin32.c index 274f39eb1d..f37033bda8 100644 --- a/libs/zlib/src/iowin32.c +++ b/libs/zlib/src/iowin32.c @@ -33,7 +33,7 @@ #endif #endif -voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode)); +voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const wchar_t* filename, int mode)); uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream)); @@ -166,7 +166,7 @@ voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int } -voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode) +voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const wchar_t* filename,int mode) { const char* mode_fopen = NULL; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; diff --git a/libs/zlib/src/zlib.def b/libs/zlib/src/zlib.def index a2188b0006..34400952d9 100644 --- a/libs/zlib/src/zlib.def +++ b/libs/zlib/src/zlib.def @@ -1,4 +1,5 @@ ; zlib data compression library +LIBRARY zlib.mir EXPORTS ; basic functions zlibVersion @@ -92,3 +93,23 @@ EXPORTS inflateResetKeep deflateResetKeep gzopen_w +; minizip functions + zipOpen2 + zipOpenNewFileInZip4_64 + zipWriteInFileInZip + zipCloseFileInZip + zipClose + unzOpen2 + unzClose + unzGoToNextFile + unzGetCurrentFileInfo + unzOpenCurrentFilePassword + unzCloseCurrentFile + unzReadCurrentFile + fill_win32_filefunc + unzGetCurrentFileInfo64 + unzOpenCurrentFile + fill_fopen64_filefunc + unzOpen2_64 + zipOpen2_64 + zipOpenNewFileInZip
\ No newline at end of file diff --git a/libs/zlib/src/zlib.h b/libs/zlib/src/zlib.h index f09cdaf1e0..8794d65bdf 100644 --- a/libs/zlib/src/zlib.h +++ b/libs/zlib/src/zlib.h @@ -1791,18 +1791,18 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, ZLIB_VERSION, (int)sizeof(z_stream)) #else # define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) # define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) # define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) + (strategy), ZLIB_VERSION, sizeof(z_stream)) # define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) + sizeof(z_stream)) # define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) + ZLIB_VERSION, sizeof(z_stream)) #endif #ifndef Z_SOLO diff --git a/libs/zlib/src/zutil.c b/libs/zlib/src/zutil.c index a76c6b0c7e..35ac5d8549 100644 --- a/libs/zlib/src/zutil.c +++ b/libs/zlib/src/zutil.c @@ -34,25 +34,25 @@ uLong ZEXPORT zlibCompileFlags() uLong flags; flags = 0; - switch ((int)(sizeof(uInt))) { + switch (sizeof(uInt)) { case 2: break; case 4: flags += 1; break; case 8: flags += 2; break; default: flags += 3; } - switch ((int)(sizeof(uLong))) { + switch (sizeof(uLong)) { case 2: break; case 4: flags += 1 << 2; break; case 8: flags += 2 << 2; break; default: flags += 3 << 2; } - switch ((int)(sizeof(voidpf))) { + switch (sizeof(voidpf)) { case 2: break; case 4: flags += 1 << 4; break; case 8: flags += 2 << 4; break; default: flags += 3 << 4; } - switch ((int)(sizeof(z_off_t))) { + switch (sizeof(z_off_t)) { case 2: break; case 4: flags += 1 << 6; break; case 8: flags += 2 << 6; break; |