summaryrefslogtreecommitdiffstats
path: root/qtruby/bin/qtrubyinit.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-11 12:52:49 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-10-13 20:22:43 +0200
commit7ad4be65ec474a9db521deee659273a6d723e0b8 (patch)
tree112d3120d4e45d88b2da47549934317b86834158 /qtruby/bin/qtrubyinit.cpp
parent90e99a3b455aae5b98700cb841707c0b70cf3664 (diff)
downloadtdebindings-7ad4be65ec474a9db521deee659273a6d723e0b8.tar.gz
tdebindings-7ad4be65ec474a9db521deee659273a6d723e0b8.zip
Fix FTBS on ruby 1.9.x
Thanks to Darrell Anderson for the majority of the patch! (cherry picked from commit ef7a60860d18e9be343b6fa5fe8d76fd080cead0)
Diffstat (limited to 'qtruby/bin/qtrubyinit.cpp')
-rw-r--r--qtruby/bin/qtrubyinit.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qtruby/bin/qtrubyinit.cpp b/qtruby/bin/qtrubyinit.cpp
index 2451e002..b17cb940 100644
--- a/qtruby/bin/qtrubyinit.cpp
+++ b/qtruby/bin/qtrubyinit.cpp
@@ -1,5 +1,13 @@
#include <ruby.h>
+#include "config.h"
+
+#ifndef HAVE_RUBY_1_9
+#define RARRAY_LEN(x) (RARRAY(x)->len)
+#define RSTRING_LEN(x) (RSTRING(x)->len)
+#define rb_str_catf_1 rb_str_catf
+#endif
+
/***************************************************************************
qrubyinit - makes use of kdeinit_wrapper possible for ruby programs
-------------------
@@ -24,6 +32,6 @@ static const char* script_name = "qrubyinit_app";
int main(int argc, char **argv) {
ruby_init();
ruby_script((char*)script_name);
- ruby_options(argc, argv);
- ruby_run();
+ void* node = ruby_options(argc, argv);
+ ruby_run_node(node);
}