Support building with recent versions of the Ruby 1.9 development branch.

Fixes bug #1560092.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9333 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2006-09-23 21:39:09 +00:00
commit 2f6a268e55
11 changed files with 137 additions and 118 deletions

View file

@ -33,7 +33,7 @@ bool SWIG_STRING_P(VALUE x) {
return TYPE(x) == T_STRING;
}
std::string SWIG_RB2STR(VALUE x) {
return std::string(RSTRING(x)->ptr, RSTRING(x)->len);
return std::string(RSTRING_PTR(x), RSTRING_LEN(x));
}
VALUE SWIG_STR2RB(const std::string& s) {
return rb_str_new(s.data(), s.size());