obexftp-0.23-fix-ruby19.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Replace functions removed with ruby 1.9
  2. See also http://dev.zuckschwerdt.org/openobex/ticket/49
  3. diff --git a/swig/charmap.i b/swig/charmap.i
  4. index e1f1fc1..b8e17de 100644
  5. --- a/swig/charmap.i
  6. +++ b/swig/charmap.i
  7. @@ -89,8 +89,8 @@
  8. $2 = PyString_Size($input);
  9. #elif defined SWIGRUBY
  10. /* VALUE str = StringValue($input); // perhaps better? */
  11. - $1 = STR2CSTR($input);
  12. - $2 = (int) RSTRING($input)->len;
  13. + $1 = StringValuePtr($input);
  14. + $2 = (int) RSTRING_LEN($input);
  15. #elif defined SWIGTCL
  16. $1 = Tcl_GetStringFromObj($input,&$2);
  17. #else
  18. diff --git a/swig/ruby/ruby_wrap.c b/swig/ruby/ruby_wrap.c
  19. index 57e40bf..31b1a9d 100644
  20. --- a/swig/ruby/ruby_wrap.c
  21. +++ b/swig/ruby/ruby_wrap.c
  22. @@ -2579,8 +2579,8 @@ _wrap_Client_put_data(int argc, VALUE *argv, VALUE self) {
  23. /* VALUE str = StringValue(argv[0]); // perhaps better? */
  24. - arg2 = STR2CSTR(argv[0]);
  25. - arg3 = (int) RSTRING(argv[0])->len;
  26. + arg2 = StringValuePtr(argv[0]);
  27. + arg3 = (int) RSTRING_LEN(argv[0]);
  28. --
  29. 1.8.4.2