Skip to content

Commit

Permalink
Fix build with minizip-ng 4.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaVandaele committed Jan 12, 2025
1 parent 93fc5c0 commit 7c36a4e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ dolphin_find_optional_system_library_pkgconfig(ZSTD libzstd>=1.4.0 zstd::zstd Ex
add_subdirectory(Externals/zlib-ng)

dolphin_find_optional_system_library_pkgconfig(MINIZIP
"minizip>=4.0.4" minizip::minizip Externals/minizip-ng
"minizip>=4.0.8" minizip::minizip Externals/minizip-ng
)

dolphin_find_optional_system_library(LZO Externals/LZO)
Expand Down
11 changes: 8 additions & 3 deletions Externals/minizip-ng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ project(minizip C)

add_library(minizip STATIC
minizip-ng/mz.h
minizip-ng/mz_compat.c
minizip-ng/mz_compat.h
# minizip-ng/compat/crypt.h
minizip-ng/compat/ioapi.c
minizip-ng/compat/ioapi.h
minizip-ng/compat/unzip.c
minizip-ng/compat/unzip.h
# minizip-ng/compat/zip.c
# minizip-ng/compat/zip.h
minizip-ng/mz_crypt.c
minizip-ng/mz_crypt.h
minizip-ng/mz_os.c
Expand Down Expand Up @@ -60,7 +65,7 @@ endif()
# minizip-ng/mz_crypt_winvista.c
# minizip-ng/mz_crypt_winxp.c

target_include_directories(minizip PUBLIC minizip-ng)
target_include_directories(minizip PUBLIC minizip-ng minizip-ng/compat)

target_compile_definitions(minizip PRIVATE HAVE_ZLIB ZLIB_COMPAT MZ_ZIP_NO_CRYPTO MZ_ZIP_NO_ENCRYPTION)
if (UNIX)
Expand Down
2 changes: 1 addition & 1 deletion Externals/minizip-ng/minizip-ng
Submodule minizip-ng updated 66 files
+22 −0 .clang-format
+1 −0 .github/dependabot.yml
+16 −6 .github/workflows/build.yml
+11 −5 .github/workflows/codeql.yml
+4 −1 .github/workflows/fuzz.yml
+53 −56 CMakeLists.txt
+1 −1 README.md
+2 −2 cmake/clone-repo.cmake
+84 −0 compat/crypt.h
+261 −0 compat/ioapi.c
+97 −0 compat/ioapi.h
+737 −0 compat/unzip.c
+238 −0 compat/unzip.h
+409 −0 compat/zip.c
+180 −0 compat/zip.h
+1 −1 doc/mz_zip_file.md
+32 −30 minizip.c
+2 −2 mz.h
+0 −1,367 mz_compat.c
+0 −411 mz_compat.h
+0 −12 mz_compat_shim.h.in
+39 −50 mz_crypt.c
+30 −30 mz_crypt.h
+33 −31 mz_crypt_apple.c
+20 −22 mz_crypt_openssl.c
+50 −54 mz_crypt_winvista.c
+30 −31 mz_crypt_winxp.c
+9 −9 mz_os.c
+27 −29 mz_os.h
+5 −6 mz_os_posix.c
+23 −27 mz_os_win32.c
+14 −22 mz_strm.c
+46 −44 mz_strm.h
+52 −48 mz_strm_buf.c
+3 −3 mz_strm_buf.h
+19 −33 mz_strm_bzip.c
+4 −4 mz_strm_bzip.h
+15 −27 mz_strm_libcomp.c
+3 −3 mz_strm_libcomp.h
+17 −27 mz_strm_lzma.c
+3 −3 mz_strm_lzma.h
+20 −22 mz_strm_mem.c
+7 −7 mz_strm_mem.h
+3 −3 mz_strm_os.h
+15 −17 mz_strm_os_posix.c
+20 −24 mz_strm_os_win32.c
+31 −35 mz_strm_pkcrypt.c
+6 −6 mz_strm_pkcrypt.h
+29 −35 mz_strm_split.c
+3 −3 mz_strm_split.h
+20 −30 mz_strm_wzaes.c
+5 −5 mz_strm_wzaes.h
+21 −31 mz_strm_zlib.c
+3 −3 mz_strm_zlib.h
+18 −28 mz_strm_zstd.c
+3 −3 mz_strm_zstd.h
+104 −105 mz_zip.c
+43 −48 mz_zip.h
+89 −117 mz_zip_rw.c
+32 −30 mz_zip_rw.h
+5 −1 test/CMakeLists.txt
+1 −0 test/fuzz/unzip_fuzzer.c
+ test/fuzz/unzip_fuzzer_seed_corpus/incorrect_number_entries.zip
+12 −1 test/fuzz/zip_fuzzer.c
+4 −1 test/test_compat.cc
+44 −0 test/test_file.cc
8 changes: 6 additions & 2 deletions Externals/minizip-ng/minizip-ng.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<!-- Ensure minizip-ng sees mz.h -->
<AdditionalIncludeDirectories>minizip-ng;minizip-ng\compat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_ZLIB;ZLIB_COMPAT;MZ_ZIP_NO_CRYPTO;MZ_ZIP_NO_ENCRYPTION;HAVE_STDINT_H;HAVE_INTTYPES_H;NO_FSEEKO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="minizip-ng\mz_compat.c" />
<ClCompile Include="minizip-ng\compat\ioapi.c" />
<ClCompile Include="minizip-ng\compat\unzip.c" />
<ClCompile Include="minizip-ng\mz_crypt.c" />
<ClCompile Include="minizip-ng\mz_os.c" />
<ClCompile Include="minizip-ng\mz_os_win32.c" />
Expand All @@ -36,7 +39,8 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="minizip-ng\mz.h" />
<ClInclude Include="minizip-ng\mz_compat.h" />
<ClCompile Include="minizip-ng\compat\ioapi.h" />
<ClCompile Include="minizip-ng\compat\unzip.h" />
<ClInclude Include="minizip-ng\mz_crypt.h" />
<ClInclude Include="minizip-ng\mz_os.h" />
<ClInclude Include="minizip-ng\mz_strm.h" />
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/MinizipUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <algorithm>

#include <mz_compat.h>
#include <unzip.h>

#include "Common/CommonTypes.h"
#include "Common/ScopeGuard.h"
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DiscIO/VolumeVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <unordered_set>

#include <mbedtls/md5.h>
#include <mz_compat.h>
#include <pugixml.hpp>
#include <unzip.h>

#include "Common/Align.h"
#include "Common/Assert.h"
Expand Down
4 changes: 3 additions & 1 deletion Source/Core/UICommon/ResourcePack/ResourcePack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <algorithm>
#include <memory>

#include <mz_compat.h>
#include <mz.h>
#include <unzip.h>

#include <mz_os.h>

#include "Common/CommonPaths.h"
Expand Down

0 comments on commit 7c36a4e

Please sign in to comment.