mirror of
https://github.com/zlib-ng/minizip-ng
synced 2025-03-28 21:13:18 +00:00
Revert windows specific changes to ioapi due to recent merge.
This commit is contained in:
parent
2251c1517e
commit
f5a316a78b
16
ioapi.c
16
ioapi.c
@ -27,10 +27,6 @@
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#if defined(WINDOWS_SUPPORT_UNICODE_PATH)
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
voidpf call_zopen64(const zlib_filefunc64_32_def *pfilefunc, const void *filename, int mode)
|
||||
{
|
||||
if (pfilefunc->zfile_func64.zopen64_file != NULL)
|
||||
@ -145,17 +141,7 @@ static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void *filename, i
|
||||
|
||||
if ((filename != NULL) && (mode_fopen != NULL))
|
||||
{
|
||||
#if defined(WINDOWS_SUPPORT_UNICODE_PATH)
|
||||
int pathLength = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
|
||||
wchar_t* newName = (wchar_t*)calloc(pathLength, sizeof(wchar_t));
|
||||
wchar_t newMode[16];
|
||||
MultiByteToWideChar(CP_UTF8, 0, filename, -1, newName, pathLength);
|
||||
mbstowcs(newMode, (const char*)mode_fopen, 16);
|
||||
file = fopen64((const wchar_t*)newName, newMode);
|
||||
free(newName);
|
||||
#else
|
||||
file = fopen64((const char*)filename, mode_fopen);
|
||||
#endif
|
||||
file = fopen64((const char*)filename, mode_fopen);
|
||||
return file_build_ioposix(file, (const char*)filename);
|
||||
}
|
||||
return file;
|
||||
|
7
ioapi.h
7
ioapi.h
@ -33,12 +33,7 @@
|
||||
# define fseeko64 fseeko
|
||||
# endif
|
||||
# ifdef _MSC_VER
|
||||
# define WINDOWS_SUPPORT_UNICODE_PATH // If defined, paths containing unicode are supported
|
||||
# if defined(WINDOWS_SUPPORT_UNICODE_PATH)
|
||||
# define fopen64 _wfopen
|
||||
# else
|
||||
# define fopen64 fopen
|
||||
# endif
|
||||
# define fopen64 fopen
|
||||
# if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
|
||||
# define ftello64 _ftelli64
|
||||
# define fseeko64 _fseeki64
|
||||
|
Loading…
x
Reference in New Issue
Block a user