mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2024-10-28 11:19:36 +01:00
Automatically load Zlib again, the right way
This commit is contained in:
parent
a2075a5023
commit
368534fd1d
1 changed files with 9 additions and 0 deletions
|
@ -270,6 +270,15 @@ static void mriBindingInit() {
|
|||
rb_str_freeze(vers);
|
||||
rb_define_const(mod, "VERSION", vers);
|
||||
|
||||
// Automatically load zlib if it's present -- the correct way this time
|
||||
int state;
|
||||
rb_eval_string_protect("require('zlib') if !Kernel.const_defined?(:Zlib)", &state);
|
||||
if (state) {
|
||||
Debug() << "Could not load Zlib. If this is important, make sure Ruby was built with static extensions, or that"
|
||||
<< ((MKXPZ_PLATFORM == MKXPZ_PLATFORM_MACOS) ? "zlib.bundle" : "zlib.so")
|
||||
<< "is present and reachable by Ruby's loadpath.";
|
||||
}
|
||||
|
||||
// Set $stdout and its ilk accordingly on Windows
|
||||
// I regret teaching you that word
|
||||
#ifdef __WIN32__
|
||||
|
|
Loading…
Reference in a new issue