Add MRI 1.8 Support #163
No reviewers
Labels
No Label
RGSS accuracy
bug
compilation
discussion
documentation
duplicate
enhancement
invalid
performance issue
port request
question
ruby incompatibility
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: MapleShrine/mkxp#163
Loading…
Reference in New Issue
No description provided.
Delete Branch "Ghabry/mri-1.8"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This allows compiling of mkxp against Ruby 1.8.7 (tested with p374).
To test that it works simply start a RPG Maker XP game. If you get "Win32Api not found" instead of "Syntax error" it works ;).
This is mostly implemented by providing wrapper functions and macros (mostly copy-pasted from ruby 2.4) in binding-util.h.
Known issues:
ruby_option (like ruby_sysinit) segfaults when called.call removed for nowrb_hash_lookup2 not implemented but this is only in a RGSS3 codepath, so not relevantrb_str_catf not implemented (so no stacktrace printed in error case)raiseDisposedAccess will never raiseThat typed data stuff was a bit tricky to fake because Ruby 1.8 does not have this typed data struct. But is good enough to launch games. Though some sanity checks are missing (see issues above)
To The Moon (Windows version) with 2.4 MRI:
With 1.8 MRI:
With 1.8 MRI and some WinApi emulation (Mouse cursor is stuck):
Also fixed compile for MRI 1.9, but this crashes with
"[BUG] object allocation during garbage collection phase"
on startup >.>
Other than the minor formatting, I can't comment too much on the 1.8 since I'm not familiar with the differences to 2.x, but I'd really like to get this merged to start the effort even if not everything is working yet.
Thanks for your work!
dead code comment?
Is there an issue with implementing this in 1.8? Does 1.8 not allow raising exceptions from C?
Edit: Oh it probably has to do with getting the class name from the typed data object, I see.
Please use /* */ for documentative comments
The rest of the code base puts opening braces on a new line
What is the equivalent 1.8 function for this?
random whitespace change?
@ -32,7 +32,9 @@
#include "boost-hash.h"
#include <ruby.h>
#ifndef RUBY_LEGACY_VERSION
If this defined by a ruby header, or do we define it?
@ -322,0 +388,4 @@
void rb_enc_set_default_external(VALUE)
{
// not relevant
missing newline at end
Calling this somehow segfaults Ruby and I have no idea why. Will remove it.
@ -32,7 +32,9 @@
#include "boost-hash.h"
#include <ruby.h>
#ifndef RUBY_LEGACY_VERSION
I define it. Problem is that checking for 1.8 vs. 1.9 is ugly to write so I introduced a new macro for 1.8 only. You can suggest a better macro name :D
I'm also coding blind because the documentation for MRI 1.8 is basicly non-existent :D
Added raiseDisposedAccess (though the reported classname will be quite useless, just some internal class(#12345678). Though the bookkeeping for storing the "emulated typed data classname" somewhere is not worth the afford imho. So the sanity checks will also not work (they always return true) but I guess they bomb a bit later then. Or do you have any ideas to solve this with not too much work?
rb_str_catf and rb_hash_lookup2 are implemented. hash_lookup is quite useless, only used in VX Ace codepath.
The stacktrace somehow only always contains one element in my tests and I have no idea why o.O
Rebased my changes but I can't test if I failed with my rebase because I can't get mkxp to compile because PhysFS changed the API >.>. I also applied @carstene1ns PR, but I still get
Any idea?
My PR is not yet updated with the change @Ancurio requested...
https://hg.icculus.org/icculus/physfs/rev/22c7dd45c588
https://hg.icculus.org/icculus/physfs/rev/97d3641bfba3
Thanks. https://gist.github.com/Ghabry/001c7e920b4a62089220866e7ce68a09 compiles for me now and can confirm that the rebase was successful 👍
Thank you for fixing my PR! =)
do you know if this works with ruby 1.8.1 specifically? iirc, the mkxp-z bindings dont
Not tested. Because it is a minor update I assumed it does not have any breaking changes. Is there any game that does not work with 1.8.7?
yeah ive found one thats throwing some subclass error or some shit,
anyway tried on ruby 1.8.1,
got
Is this the only error?
Replace the content of my rb_hash_lookup2 function with
return def
Should be fine because it is only used by rgss3 code
maybe add like ifdef RUBY_API_VERSION_TEENY == 1
anyway it built, but does not seem to work, even with a basic RTP project :D
Well no idea then.
Needs more work to find the underlying issue first
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Forgejo.