summaryrefslogtreecommitdiff
path: root/ext/tk
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk')
-rw-r--r--ext/tk/extconf.rb2
-rw-r--r--ext/tk/stubs.c2
-rw-r--r--ext/tk/tcltklib.c5
-rw-r--r--ext/tk/tkutil/extconf.rb1
-rw-r--r--ext/tk/tkutil/tkutil.c9
5 files changed, 10 insertions, 9 deletions
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 5ed86a8b76..123899043a 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -307,6 +307,8 @@ if tcltk_framework ||
$INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
# create
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
+ $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
create_makefile("tcltklib")
end
end
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 426505f3ae..d0aaf61f31 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -1,5 +1,5 @@
#include "stubs.h"
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <tcl.h>
#include <tk.h>
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 498944d453..4f779c731e 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -6,9 +6,8 @@
#define TCLTKLIB_RELEASE_DATE "2006-12-01"
-#include "ruby.h"
-#include "rubysig.h"
-#include "version.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
#undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
#include <stdio.h>
#ifdef HAVE_STDARG_PROTOTYPES
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
index dd00d5d535..51f775619c 100644
--- a/ext/tk/tkutil/extconf.rb
+++ b/ext/tk/tkutil/extconf.rb
@@ -7,5 +7,6 @@ end
if has_tk
require 'mkmf'
+ have_func("rb_obj_instance_exec", "ruby.h")
create_makefile('tkutil')
end
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 0b2597ec1a..25c4af742d 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -10,10 +10,9 @@
#define TKUTIL_RELEASE_DATE "2006-04-06"
-#include "ruby.h"
-#include "rubysig.h"
-#include "version.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/st.h"
static VALUE cMethod;
@@ -59,7 +58,7 @@ tk_s_new(argc, argv, klass)
VALUE obj = rb_class_new_instance(argc, argv, klass);
if (rb_block_given_p()) {
-#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR <= 8 /* ruby 1.8.x */
+#ifndef HAVE_RB_OBJ_INSTANCE_EXEC
rb_obj_instance_eval(0, 0, obj);
#else
rb_obj_instance_exec(1, &obj, obj);