Update zconf.h prefixes to match zlib v1.2.12 update

Historically Qt has used `Z_PREFIX` within zconf.h of its bundled zlib
copy to prefix all zlib symbols with `z_` in order to prevent clashes
with a potential system install of the library when linking statically;
however, v1.2.12 introduced 3 new functions that were erroneously not
accounted for in the upstream repository:

- crc32_combine_gen
- crc32_combine_gen64
- crc32_combine_op

`403020` updated our bundled zlib to this new version and therefore
Qt has inherited this oversight, now clashing with external zlib
builds.

Manually add prefix macro definitions for these three symbols to
restore built-in zlib to its previous clash free state while waiting
for the issue to be addressed upstream.

Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I83f88109a08cf7e7117f1c94b4557a2c36f519c3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Christian Heimlich 2022-09-01 09:00:27 -04:00
parent a7657d3c5f
commit 54ea62756a
2 changed files with 15 additions and 2 deletions

View File

@ -54,7 +54,17 @@ diff -ruN orig/zconf.h src/zconf.h
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
@@ -136,6 +139,7 @@
@@ -38,6 +41,9 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
+# define crc32_combine_gen z_crc32_combine_gen
+# define crc32_combine_gen64 z_crc32_combine_gen64
+# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
@@ -136,6 +142,7 @@
# endif
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
@ -62,7 +72,7 @@ diff -ruN orig/zconf.h src/zconf.h
/* all zlib typedefs in zlib.h and zconf.h */
# define Byte z_Byte
@@ -431,7 +435,7 @@
@@ -431,7 +438,7 @@
typedef unsigned long z_crc_t;
#endif

View File

@ -41,6 +41,9 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define crc32_combine_gen z_crc32_combine_gen
# define crc32_combine_gen64 z_crc32_combine_gen64
# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound