kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Ruby 1.8 fixes
@ 2014-02-05  7:56 normalperson
  2014-02-05  7:56 ` [PATCH 1/2] only define and test kgio_syssend on 1.9+ normalperson
  2014-02-05  7:56 ` [PATCH 2/2] various 1.8.7 fixes normalperson
  0 siblings, 2 replies; 3+ messages in thread
From: normalperson @ 2014-02-05  7:56 UTC (permalink / raw)
  To: kgio

gem install --pre -v 2.9.0.2.gf33a kgio

Eric Wong (2):
      only define and test kgio_syssend on 1.9+
      various 1.8.7 fixes



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] only define and test kgio_syssend on 1.9+
  2014-02-05  7:56 [PATCH 0/2] Ruby 1.8 fixes normalperson
@ 2014-02-05  7:56 ` normalperson
  2014-02-05  7:56 ` [PATCH 2/2] various 1.8.7 fixes normalperson
  1 sibling, 0 replies; 3+ messages in thread
From: normalperson @ 2014-02-05  7:56 UTC (permalink / raw)
  To: kgio

From: Eric Wong <e@80x24.org>

Reported-by: Christopher Rigor <crigor@gmail.com>
---
 ext/kgio/write.c     | 2 +-
 test/test_syssend.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ext/kgio/write.c b/ext/kgio/write.c
index 04f2866..ad34bdd 100644
--- a/ext/kgio/write.c
+++ b/ext/kgio/write.c
@@ -261,7 +261,7 @@ void init_kgio_write(void)
 	rb_define_method(mSocketMethods, "kgio_write", kgio_send, 1);
 	rb_define_method(mSocketMethods, "kgio_trywrite", kgio_trysend, 1);
 
-#ifdef USE_MSG_DONTWAIT
+#if defined(KGIO_HAVE_THREAD_CALL_WITHOUT_GVL)
 	rb_define_method(mSocketMethods, "kgio_syssend", kgio_syssend, 2);
 #endif
 }
diff --git a/test/test_syssend.rb b/test/test_syssend.rb
index 5089ce3..7d2511a 100644
--- a/test/test_syssend.rb
+++ b/test/test_syssend.rb
@@ -40,4 +40,4 @@ class TestKgioSyssend < Test::Unit::TestCase
   ensure
     [ srv, acc, client ].each { |io| io.close if io }
   end
-end if RUBY_PLATFORM =~ /linux/
+end if RUBY_PLATFORM =~ /linux/ && Socket.const_defined?(:MSG_MORE)
-- 
1.8.5.3.368.gab0bcec



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] various 1.8.7 fixes
  2014-02-05  7:56 [PATCH 0/2] Ruby 1.8 fixes normalperson
  2014-02-05  7:56 ` [PATCH 1/2] only define and test kgio_syssend on 1.9+ normalperson
@ 2014-02-05  7:56 ` normalperson
  1 sibling, 0 replies; 3+ messages in thread
From: normalperson @ 2014-02-05  7:56 UTC (permalink / raw)
  To: kgio

From: Eric Wong <e@80x24.org>

Some errors in the code reorganization caused some compatibility
code to be dropped :x
---
 ext/kgio/kgio.h   |  6 ++++++
 ext/kgio/write.c  |  5 -----
 ext/kgio/writev.c | 11 +++++++++++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ext/kgio/kgio.h b/ext/kgio/kgio.h
index 4ccd7c2..6c5da5b 100644
--- a/ext/kgio/kgio.h
+++ b/ext/kgio/kgio.h
@@ -96,4 +96,10 @@ static inline void kgio_autopush_write(VALUE io) { }
 #else
 static inline void kgio_autopush_write(VALUE io) { kgio_autopush_send(io); }
 #endif
+
+/* prefer rb_str_subseq because we don't use negative offsets */
+#ifndef HAVE_RB_STR_SUBSEQ
+#define rb_str_subseq rb_str_substr
+#endif
+
 #endif /* KGIO_H */
diff --git a/ext/kgio/write.c b/ext/kgio/write.c
index ad34bdd..fa152d8 100644
--- a/ext/kgio/write.c
+++ b/ext/kgio/write.c
@@ -4,11 +4,6 @@
 #include "nonblock.h"
 static VALUE sym_wait_writable;
 
-/* prefer rb_str_subseq because we don't use negative offsets */
-#ifndef HAVE_RB_STR_SUBSEQ
-#define rb_str_subseq rb_str_substr
-#endif
-
 struct wr_args {
 	VALUE io;
 	VALUE buf;
diff --git a/ext/kgio/writev.c b/ext/kgio/writev.c
index a723b68..aafc6d8 100644
--- a/ext/kgio/writev.c
+++ b/ext/kgio/writev.c
@@ -19,6 +19,17 @@ static ssize_t assert_writev(int fd, void* iov, int len)
 }
 #  define writev assert_writev
 #endif
+
+#ifndef HAVE_RB_ARY_SUBSEQ
+static inline VALUE my_ary_subseq(VALUE ary, long idx, long len)
+{
+       VALUE args[2] = { LONG2FIX(idx), LONG2FIX(len) };
+
+       return rb_ary_aref(2, args, ary);
+}
+#define rb_ary_subseq my_ary_subseq
+#endif
+
 static VALUE sym_wait_writable;
 
 #ifndef HAVE_WRITEV
-- 
1.8.5.3.368.gab0bcec



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-05  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05  7:56 [PATCH 0/2] Ruby 1.8 fixes normalperson
2014-02-05  7:56 ` [PATCH 1/2] only define and test kgio_syssend on 1.9+ normalperson
2014-02-05  7:56 ` [PATCH 2/2] various 1.8.7 fixes normalperson

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).