Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ZLib With A Submodules (v3.0) #94

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TheBrokenRail
Copy link
Contributor

This PR does two things:

  1. It modifies the CMake build to use the system's ZLib, rather than the vendored version.
  2. It replaces the vendored version with a submodule of the same version.

One thing to note: the submodule version is ZLib is almost identical to the old version, except for one change:

--- zlib/gzguts.h
+++ zlib-old/gzguts.h
@@ -37,13 +37,15 @@
 
 #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
 #  include <io.h>
+#else
+#  include <unistd.h>
 #endif
 
 #if defined(_WIN32)
 #  define WIDECHAR
 #endif
 
-#ifdef WINAPI_FAMILY
+#if defined(WINAPI_FAMILY) || defined(_WIN32)
 #  define open _open
 #  define read _read
 #  define write _write

I do not know why the old version of ZLib had undocumented changes, but the submodule version doesn't.

@TheBrokenRail TheBrokenRail marked this pull request as ready for review November 3, 2023 02:33
@iProgramMC
Copy link
Member

iProgramMC commented Nov 3, 2023

So how did you embed those changes into the submodule zlib?

What I know is that I had to add those because the game wouldn't build otherwise.

@TheBrokenRail
Copy link
Contributor Author

You can't easily patch submodules. I'd suggest just adding the WINAPI_FAMILY define to the VS build so the patch isn't needed.

@TheBrokenRail
Copy link
Contributor Author

I'm going to mark this as a draft for now

@TheBrokenRail TheBrokenRail marked this pull request as draft December 6, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants