Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save toto/83624 to your computer and use it in GitHub Desktop.
Save toto/83624 to your computer and use it in GitHub Desktop.
Patch to make the levenshtein gem ruby 1.9 compatible
3,9d2
< /* Ruby 1.8 compatibility macros, these are defined in Ruby 1.9
< so the ones below will only be used in 1.8.x */
< #ifndef RSTRING_PTR
< # define RSTRING_PTR(s) (RSTRING(s)->ptr)
< # define RSTRING_LEN(s) (RSTRING(s)->len)
< #endif
<
22,23c15,16
< s1 = RSTRING_PTR(rb_s1);
< l1 = RSTRING_LEN(rb_s1);
---
> s1 = RSTRING(rb_s1)->ptr;
> l1 = RSTRING(rb_s1)->len;
28,29c21,22
< s2 = RSTRING_PTR(rb_s2);
< l2 = RSTRING_LEN(rb_s2);
---
> s2 = RSTRING(rb_s2)->ptr;
> l2 = RSTRING(rb_s2)->len;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment