Skip to content

Instantly share code, notes, and snippets.

View toto's full-sized avatar

Thomas Kollbach toto

View GitHub Profile
@toto
toto / makes_levenshtein gem_ruby_1.9_compatible.diff
Created March 23, 2009 16:08
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);