Project

General

Profile

Actions

Emulator Issues #13515

closed

Dolphin does not build with Minizip-ng 4.0.4.

Added by brad 25 days ago. Updated 8 days ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-21443

Description

Dolphin does not build with Minizip-ng 4.0.4.

https://github.com/dolphin-emu/dolphin/commit/a5d06fde4b597d93750ba29bc2db83401fe431f7

Changed the last parameter to unzLocateFile() from 0 to NULL.

https://github.com/zlib-ng/minizip-ng/commit/6c5f265a55f1a12a7a016cd2962feff91cff5d2e

MZ_COMPAT_VERSION is not defined. unzFileNameCase is an int.

#if !defined(MZ_COMPAT_VERSION) || MZ_COMPAT_VERSION < 110
ZEXPORT int     unzLocateFile(unzFile file, const char *filename, unzFileNameCase filename_case);
#else
ZEXPORT int     unzLocateFile(unzFile file, const char* filename, unzFileNameComparer filename_compare_func);
#endif
/home/ports/pobj/dolphin-5.0.0.20230722/dolphin-5.0.0.20230722/Source/Core/UICommon/ResourcePack/ResourcePack.cpp:39:7: error: no matching function for call to 'unzLocateFile'
  if (unzLocateFile(file, "manifest.json", nullptr) == UNZ_END_OF_LIST_OF_FILE)
      ^~~~~~~~~~~~~
/usr/local/include/minizip/mz_compat.h:364:17: note: candidate function not viable: no known conversion from 'std::nullptr_t' to 'unzFileNameCase' (aka 'int') for 3rd argument
ZEXPORT int     unzLocateFile(unzFile file, const char *filename, unzFileNameCase filename_case);
                ^
/home/ports/pobj/dolphin-5.0.0.20230722/dolphin-5.0.0.20230722/Source/Core/UICommon/ResourcePack/ResourcePack.cpp:66:7: error: no matching function for call to 'unzLocateFile'
  if (unzLocateFile(file, "logo.png", nullptr) != UNZ_END_OF_LIST_OF_FILE)
      ^~~~~~~~~~~~~
/usr/local/include/minizip/mz_compat.h:364:17: note: candidate function not viable: no known conversion from 'std::nullptr_t' to 'unzFileNameCase' (aka 'int') for 3rd argument
ZEXPORT int     unzLocateFile(unzFile file, const char *filename, unzFileNameCase filename_case);
                ^
2 errors generated.

Related issues 1 (1 open0 closed)

Related to Emulator - Emulator Issues #13169: Compilation error on Fedora Linux - minizip vs minizip-ngNew

Actions
Actions #1

Updated by Billiard26 24 days ago

Actions #2

Updated by brad 24 days ago

So we have a local patch to change the last parameter to unzLocateFile() back to zero.

Actions #3

Updated by Billiard26 24 days ago

Changing the last argument to 0 is a bit of a hacky fix, imo. Zero just happens to work for both versions of the function since C++ is so weakly-typed in this situation.

It looks like the proper fix is to #define MZ_COMPAT_VERSION appropriately to always use the pointer version of the function.

Actions #4

Updated by brad 24 days ago

Billiard26 wrote in #note-3:

Changing the last argument to 0 is a bit of a hacky fix, imo. Zero just happens to work for both versions of the function since C++ is so weakly-typed in this situation.

It looks like the proper fix is to #define MZ_COMPAT_VERSION appropriately to always use the pointer version of the function.

Oh I'm definitely not trying to imply it is the proper and most appropriate fix. Just something to get it to build for now.

I filed the bug report to try to have a more appropriate fix.

Actions

Also available in: Atom PDF