Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ext/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def copy_gem(gem_dir)
# thanks to: https://gist.github.com/IanVaughan/5489431
$CPPFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /1.9/
$CPPFLAGS += " -DRUBY_20" if RUBY_VERSION =~ /2.0/
$CPPFLAGS += " -DRUBY_21" if RUBY_VERSION =~ /2.1/
$CPPFLAGS += " -DRUBY_22" if RUBY_VERSION =~ /2.2/

puts "*** Using Ruby version: #{RUBY_VERSION}"
puts "*** with CPPFLAGS: #{$CPPFLAGS}"
Expand Down
2 changes: 1 addition & 1 deletion ext/native_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static VALUE mc_initialize(VALUE self, VALUE opts) {
return self;
}

#if defined(RUBY_19) || defined(RUBY_20)
#if defined(RUBY_19) || defined(RUBY_20) || defined(RUBY_21) || defined(RUBY_22)
#define RSTRING_SET_LEN(str, newlen) (rb_str_set_len(str, new_len))
#else
#define RSTRING_SET_LEN(str, newlen) (RSTRING(str)->len = new_len)
Expand Down