summaryrefslogtreecommitdiff
path: root/plugins/Zlib/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-07 20:31:50 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-07 20:31:50 +0000
commit39de8f56fe51fb8fe82f290d1008eb1381c53290 (patch)
tree337d658a44390c16d102c4e54ecc4ca3c19cc1c5 /plugins/Zlib/src
parentf2b61a664ae3660ad503eee73ef82ee562a5a5db (diff)
perverted zlib with TCHAR file names
git-svn-id: http://svn.miranda-ng.org/main/trunk@5618 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Zlib/src')
-rw-r--r--plugins/Zlib/src/ioapi.c26
-rw-r--r--plugins/Zlib/src/ioapi.h3
-rw-r--r--plugins/Zlib/src/iowin32.c4
-rw-r--r--plugins/Zlib/src/unzip.h2
4 files changed, 19 insertions, 16 deletions
diff --git a/plugins/Zlib/src/ioapi.c b/plugins/Zlib/src/ioapi.c
index 7f5c191b2a..8c601556c1 100644
--- a/plugins/Zlib/src/ioapi.c
+++ b/plugins/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 TCHAR*)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 TCHAR* 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 TCHAR* filename, int mode)
{
FILE* file = NULL;
- const char* mode_fopen = NULL;
+ const TCHAR* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
+ mode_fopen = _T("rb");
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
+ mode_fopen = _T("r+b");
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
+ mode_fopen = _T("wb");
if ((filename!=NULL) && (mode_fopen != NULL))
- file = fopen(filename, mode_fopen);
+ file = _tfopen(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 TCHAR* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
+ mode_fopen = _T("rb");
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
+ mode_fopen = _T("r+b");
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
+ mode_fopen = _T("wb");
if ((filename!=NULL) && (mode_fopen != NULL))
- file = FOPEN_FUNC((const char*)filename, mode_fopen);
+ file = _tfopen((const TCHAR*)filename, mode_fopen);
return file;
}
diff --git a/plugins/Zlib/src/ioapi.h b/plugins/Zlib/src/ioapi.h
index 8dcbdb06e3..20cacd9427 100644
--- a/plugins/Zlib/src/ioapi.h
+++ b/plugins/Zlib/src/ioapi.h
@@ -41,6 +41,7 @@
#endif
+#include <tchar.h>
#include <stdio.h>
#include <stdlib.h>
#include "zlib.h"
@@ -132,7 +133,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 TCHAR* 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/plugins/Zlib/src/iowin32.c b/plugins/Zlib/src/iowin32.c
index a46d96c7fd..1eea0f4399 100644
--- a/plugins/Zlib/src/iowin32.c
+++ b/plugins/Zlib/src/iowin32.c
@@ -32,7 +32,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 TCHAR* 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));
@@ -165,7 +165,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 TCHAR* filename,int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
diff --git a/plugins/Zlib/src/unzip.h b/plugins/Zlib/src/unzip.h
index 2104e39150..7271687ac8 100644
--- a/plugins/Zlib/src/unzip.h
+++ b/plugins/Zlib/src/unzip.h
@@ -47,6 +47,8 @@
extern "C" {
#endif
+#define _CRT_SECURE_NO_WARNINGS
+
#ifndef _ZLIB_H
#include "zlib.h"
#endif