From 0d26b33eaa7c9903704179645d7ee3839ee6ceed Mon Sep 17 00:00:00 2001 From: martell Date: Sat, 11 Oct 2014 04:39:42 +0100 Subject: [PATCH] mingw64: mirgrate to upstream minizip --- cocos/base/ZipUtils.cpp | 6 ++++++ cocos/platform/CCFileUtils.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/cocos/base/ZipUtils.cpp b/cocos/base/ZipUtils.cpp index 04c7f1a02f..eb2938dc22 100644 --- a/cocos/base/ZipUtils.cpp +++ b/cocos/base/ZipUtils.cpp @@ -36,6 +36,12 @@ #include "platform/CCFileUtils.h" #include +// FIXME: Other platforms should use upstream minizip like mingw-w64 +#ifdef __MINGW32__ +#define unzGoToFirstFile64(A,B,C,D) unzGoToFirstFile2(A,B,C,D, NULL, 0, NULL, 0) +#define unzGoToNextFile64(A,B,C,D) unzGoToNextFile2(A,B,C,D, NULL, 0, NULL, 0) +#endif + NS_CC_BEGIN unsigned int ZipUtils::s_uEncryptedPvrKeyParts[4] = {0,0,0,0}; diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index 13d5940b9a..49e0a9d9be 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -648,7 +648,12 @@ unsigned char* FileUtils::getFileDataFromZip(const std::string& zipFilePath, con file = unzOpen(zipFilePath.c_str()); CC_BREAK_IF(!file); + // FIXME: Other platforms should use upstream minizip like mingw-w64 + #ifdef __MINGW32__ + int ret = unzLocateFile(file, filename.c_str(), NULL); + #else int ret = unzLocateFile(file, filename.c_str(), 1); + #endif CC_BREAK_IF(UNZ_OK != ret); char filePathA[260];