Skip to content

Commit e31d1d0

Browse files
Split ZLIB patch into two patches (#460)
### Split ZLIB patch into two patches ### Linked issues #459 ### Summarize your change. Split the patch into two patches ### Describe the reason for the change. The patch file had changes for multiple files and it causes issues on macOS. I separated the patch into two files to resolves the issue. ### Describe what you have tested and on which operating system. MacOS ### Add a list of changes, and note any that might need special attention during the review. n/a ### If possible, provide screenshots. n/a Signed-off-by: Cédrik Fuoco <[email protected]>
1 parent 40ac4df commit e31d1d0

File tree

4 files changed

+54
-53
lines changed

4 files changed

+54
-53
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
2+
index a7f24cc..a1b359b 100644
3+
--- a/zconf.h.cmakein
4+
+++ b/zconf.h.cmakein
5+
@@ -434,11 +434,19 @@ typedef uLong FAR uLongf;
6+
#endif
7+
8+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
9+
-# define Z_HAVE_UNISTD_H
10+
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
11+
+# define Z_HAVE_UNISTD_H
12+
+# elif HAVE_UNISTD_H != 0
13+
+# define Z_HAVE_UNISTD_H
14+
+# endif
15+
#endif
16+
17+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
18+
-# define Z_HAVE_STDARG_H
19+
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
20+
+# define Z_HAVE_STDARG_H
21+
+# elif HAVE_STDARG_H != 0
22+
+# define Z_HAVE_STDARG_H
23+
+# endif
24+
#endif
25+
26+
#ifdef STDC
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/zconf.h.in b/zconf.h.in
2+
index 5e1d68a..32f53c8 100644
3+
--- a/zconf.h.in
4+
+++ b/zconf.h.in
5+
@@ -432,11 +432,19 @@ typedef uLong FAR uLongf;
6+
#endif
7+
8+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
9+
-# define Z_HAVE_UNISTD_H
10+
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
11+
+# define Z_HAVE_UNISTD_H
12+
+# elif HAVE_UNISTD_H != 0
13+
+# define Z_HAVE_UNISTD_H
14+
+# endif
15+
#endif
16+
17+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
18+
-# define Z_HAVE_STDARG_H
19+
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
20+
+# define Z_HAVE_STDARG_H
21+
+# elif HAVE_STDARG_H != 0
22+
+# define Z_HAVE_STDARG_H
23+
+# endif
24+
#endif
25+
26+
#ifdef STDC

cmake/dependencies/patch/zlib_Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch

Lines changed: 0 additions & 52 deletions
This file was deleted.

cmake/dependencies/zlib.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ ENDIF()
107107
# The name of the patch is kept as is. See https://github.com/microsoft/vcpkg/tree/master/ports/zlib
108108
# Description: Fix unistd.h being incorrectly required when imported from a project defining HAVE_UNISTD_H=0
109109
SET(_patch_command
110-
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/zlib_Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
110+
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/zconf.h.cmakein_prevent_invalid_inclusions.patch
111+
&& patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/zconf.h.in_prevent_invalid_inclusions.patch
111112
)
112113

113114
EXTERNALPROJECT_ADD(

0 commit comments

Comments
 (0)