[Kde-bindings] KDE/kdebindings/ruby/qtruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Fri Jul 24 17:59:06 UTC 2009
SVN commit 1001987 by rdale:
* Replace the obsolete STR2CSTR macro with StringValueCStr to make QtRuby
compile with Ruby 1.9.2. Thanks to Youhei Kondou for the patch.
CCMAIL: kde-bindings at kde.org
M +4 -0 ChangeLog
M +4 -3 src/marshall_types.cpp
M +3 -0 src/qtruby.h
--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #1001986:1001987
@@ -1,3 +1,7 @@
+2009-07-24 Richard Dale <richard.j.dale at gmail.com>
+ * Replace the obsolete STR2CSTR macro with StringValueCStr to make QtRuby
+ compile with Ruby 1.9.2. Thanks to Youhei Kondou for the patch.
+
2009-07-21 Richard Dale <richard.j.dale at gmail.com>
* Revert a commit made by 'divide' some time ago. It was a hack to allow
primitive types to be passed as arguments where the expected arg type
--- trunk/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp #1001986:1001987
@@ -80,17 +80,18 @@
VALUE info = rb_gv_get("$!");
VALUE bt = rb_funcall(info, rb_intern("backtrace"), 0);
VALUE message = RARRAY_PTR(bt)[0];
+ VALUE message2 = rb_obj_as_string(info);
QString errormessage = QString("%1: %2 (%3)")
- .arg( STR2CSTR(message) )
- .arg( STR2CSTR(rb_obj_as_string(info)) )
+ .arg( StringValueCStr(message) )
+ .arg( StringValueCStr(message2) )
.arg( rb_class2name(CLASS_OF(info)) );
fprintf(stderr, "%s\n", errormessage.toLatin1().data());
QString tracemessage;
for(int i = 1; i < RARRAY_LEN(bt); ++i) {
if( TYPE(RARRAY_PTR(bt)[i]) == T_STRING ) {
- QString s = QString("%1\n").arg( STR2CSTR(RARRAY_PTR(bt)[i]) );
+ QString s = QString("%1\n").arg( StringValueCStr(RARRAY_PTR(bt)[i]) );
Q_ASSERT( ! s.isNull() );
tracemessage += s;
fprintf(stderr, "\t%s", s.toLatin1().data());
--- trunk/KDE/kdebindings/ruby/qtruby/src/qtruby.h #1001986:1001987
@@ -40,6 +40,9 @@
#if !defined RARRAY_PTR
#define RARRAY_PTR(a) RARRAY(a)->ptr
#endif
+#if !defined StringValueCStr
+#define StringValueCStr(s) STR2CSTR(s)
+#endif
inline bool operator==(const Smoke::ModuleIndex& a, const Smoke::ModuleIndex& b) {
if (a.index == b.index && a.smoke == b.smoke)
More information about the Kde-bindings
mailing list