From e2af015a57a276e4bca23f03cc26e947a582e9d0 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Fri, 11 Dec 2020 21:43:09 +0530 Subject: [PATCH] Common: Fix GCC error invalid conversion in MINGW. --- code/CMakeLists.txt | 2 +- code/Common/ZipArchiveIOSystem.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index bb83a5f97..7a017cfa4 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1015,7 +1015,7 @@ ENDIF() # RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file # has implementation for different platforms: WIN32, __MACH__ and other ("else" block). FIND_PACKAGE(RT QUIET) -IF (NOT ASSIMP_HUNTER_ENABLED AND (RT_FOUND OR MSVC)) +IF (NOT ASSIMP_HUNTER_ENABLED AND (RT_FOUND OR WIN32)) SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 ) ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 ) ELSE () diff --git a/code/Common/ZipArchiveIOSystem.cpp b/code/Common/ZipArchiveIOSystem.cpp index f55f9ff53..6cd50739e 100644 --- a/code/Common/ZipArchiveIOSystem.cpp +++ b/code/Common/ZipArchiveIOSystem.cpp @@ -146,7 +146,7 @@ int IOSystem2Unzip::testerror(voidpf /*opaque*/, voidpf /*stream*/) { zlib_filefunc_def IOSystem2Unzip::get(IOSystem *pIOHandler) { zlib_filefunc_def mapping; -#ifdef ASSIMP_USE_HUNTER +#if defined (ASSIMP_USE_HUNTER) || defined (__MINGW32__) // GH#3144 mapping.zopen_file = (open_file_func)open; mapping.zread_file = (read_file_func)read; mapping.zwrite_file = (write_file_func)write; @@ -335,7 +335,7 @@ ZipArchiveIOSystem::Implement::Implement(IOSystem *pIOHandler, const char *pFile if (pFilename[0] == 0 || nullptr == pMode) { return; } - + zlib_filefunc_def mapping = IOSystem2Unzip::get(pIOHandler); m_ZipFileHandle = unzOpen2(pFilename, &mapping); }