Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/miniz
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2019-05-31 17:54:42 +0300
committertamasmeszaros <meszaros.q@gmail.com>2019-06-02 20:06:29 +0300
commitf275cdafa96187691cfd7e1089722c983ad2a6ed (patch)
tree14f651fe27dbb3ffd1c5caf5885aea3cb7af9ade /src/miniz
parent34663a3514e6432eec520b60349f190a14f8a66a (diff)
Revert "Patch miniz bundled version to support unicode on Windows."
This reverts commit 8fc1eba652165869accaa4c9b7aad53203777137.
Diffstat (limited to 'src/miniz')
-rw-r--r--src/miniz/miniz.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/miniz/miniz.c b/src/miniz/miniz.c
index 8f5b97679..9ded4c75a 100644
--- a/src/miniz/miniz.c
+++ b/src/miniz/miniz.c
@@ -2987,43 +2987,17 @@ extern "C" {
#include <sys/stat.h>
#if defined(_MSC_VER) || defined(__MINGW64__)
-
-#include <windows.h>
-
-struct WArgs { const wchar_t *fname, *mode; };
-static struct WArgs utf8towide(const char* fname_utf8, const char * modestr)
-{
- static wchar_t buff[4096];
- static wchar_t mode[50];
- struct WArgs ret = { .fname = NULL, .mode = NULL };
-
- if(MultiByteToWideChar(CP_UTF8, 0, fname_utf8, -1, buff, 4096) == 0)
- return ret;
-
- if(MultiByteToWideChar(CP_UTF8, 0, modestr, -1, mode, 50) == 0)
- return ret;
-
- ret.fname = buff, ret.mode = mode;
- return ret;
-}
static FILE *mz_fopen(const char *pFilename, const char *pMode)
{
FILE *pFile = NULL;
-
- struct WArgs args = utf8towide(pFilename, pMode);
- if(args.fname != NULL && args.mode != NULL)
- if(_wfopen_s(&pFile, args.fname, args.mode)) return NULL;
-
+ fopen_s(&pFile, pFilename, pMode);
return pFile;
}
static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream)
{
FILE *pFile = NULL;
-
- struct WArgs args = utf8towide(pPath, pMode);
- if(args.fname != NULL && args.mode != NULL)
- if(_wfreopen_s(&pFile, args.fname, args.mode, pStream)) return NULL;
-
+ if (freopen_s(&pFile, pPath, pMode, pStream))
+ return NULL;
return pFile;
}
#ifndef MINIZ_NO_TIME