summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-26 22:40:22 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-26 22:40:22 +0000
commit435f18f513fdaa77c9922f564df577110641a0a2 (patch)
tree68ca78f40544ec6f65b428dd513dcaec83793bec
parent1fe610b5885217a9bac6d9a5ef74c79589c5fbca (diff)
* ext/tk/tcltklib.c,stubs.c: remove errors or warnings when compiled
with old ruby 1.8.x. * ext/tk/tkutil/tkutil.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/tk/stubs.c6
-rw-r--r--ext/tk/tcltklib.c11
-rw-r--r--ext/tk/tkutil/tkutil.c18
4 files changed, 40 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a3febde58..1fa3f9671a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 27 07:38:39 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/tcltklib.c,stubs.c: remove errors or warnings when compiled
+ with old ruby 1.8.x.
+
+ * ext/tk/tkutil/tkutil.c: ditto.
+
Tue Oct 27 05:56:39 2009 NARUSE, Yui <naruse@ruby-lang.org>
* vm.c (invoke_block_from_c): return Qnil when its iseq is
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 4388fb294d..762fe5ea8d 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -6,6 +6,12 @@
#include "ruby.h"
#include "stubs.h"
+
+#if !defined(RSTRING_PTR)
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
#include <tcl.h>
#include <tk.h>
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 2938536cda..2052582b77 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -4,7 +4,7 @@
* Oct. 24, 1997 Y. Matsumoto
*/
-#define TCLTKLIB_RELEASE_DATE "2009-08-09"
+#define TCLTKLIB_RELEASE_DATE "2009-10-27"
#include "ruby.h"
@@ -24,6 +24,15 @@ int rb_thread_check_trap_pending();
#include "rubysig.h"
#endif
+a#if !defined(RSTRING_PTR)
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+#if !defined(RARRAY_PTR)
+#define RARRAY_PTR(s) (RARRAY(s)->ptr)
+#define RARRAY_LEN(s) (RARRAY(s)->len)
+#endif
+
#ifdef OBJ_UNTRUST
#define RbTk_OBJ_UNTRUST(x) do {OBJ_TAINT(x); OBJ_UNTRUST(x);} while (0)
#else
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 25011bb473..6a670ce6fa 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -7,7 +7,7 @@
************************************************/
-#define TKUTIL_RELEASE_DATE "2009-07-12"
+#define TKUTIL_RELEASE_DATE "2009-10-27"
#include "ruby.h"
@@ -23,6 +23,22 @@ static VALUE rb_thread_critical; /* dummy */
#include "st.h"
#endif
+#if !defined(RHASH_TBL)
+#define RHASH_TBL(h) (RHASH(h)->tbl)
+#endif
+#if !defined(RSTRING_PTR)
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+#if !defined(RARRAY_PTR)
+#define RARRAY_PTR(s) (RARRAY(s)->ptr)
+#define RARRAY_LEN(s) (RARRAY(s)->len)
+#endif
+
+#if defined(HAVE_STRNDUP) && !defined(_GNU_SOURCE)
+extern char *strndup(const char* _ptr, size_t _len);
+#endif
+
static VALUE cMethod;
static VALUE cTclTkLib;