From ef7a60860d18e9be343b6fa5fe8d76fd080cead0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 11 Sep 2012 12:52:49 -0500 Subject: Fix FTBS on ruby 1.9.x Thanks to Darrell Anderson for the majority of the patch! --- qtruby/bin/Makefile.am | 2 +- qtruby/bin/qtrubyinit.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'qtruby/bin') diff --git a/qtruby/bin/Makefile.am b/qtruby/bin/Makefile.am index e53bd0fc..0e1dbdba 100644 --- a/qtruby/bin/Makefile.am +++ b/qtruby/bin/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) +INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS) bin_PROGRAMS = qtrubyinit qtrubyinit_LDFLAGS = -module $(all_libraries) -version-info 0:0:0 -L$(top_srcdir)/smoke/qt/ -L$(RUBY_LIBDIR) diff --git a/qtruby/bin/qtrubyinit.cpp b/qtruby/bin/qtrubyinit.cpp index c4e80240..65c00c40 100644 --- a/qtruby/bin/qtrubyinit.cpp +++ b/qtruby/bin/qtrubyinit.cpp @@ -1,5 +1,13 @@ #include +#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 tdeinit_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); } -- cgit v1.2.1