[ruby-oci8-commit] [537] trunk/ruby-oci8: Fix to compile for various ruby versions.

nobody at rubyforge.org nobody at rubyforge.org
Sun Oct 28 05:52:45 UTC 2012


Revision: 537
Author:   kubo
Date:     2012-10-28 05:52:44 +0000 (Sun, 28 Oct 2012)
Log Message:
-----------
Fix to compile for various ruby versions.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/extconf.rb
    trunk/ruby-oci8/ext/oci8/oci8.h
    trunk/ruby-oci8/ext/oci8/oci8lib.c
    trunk/ruby-oci8/setup.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-10-28 04:51:34 UTC (rev 536)
+++ trunk/ruby-oci8/ChangeLog	2012-10-28 05:52:44 UTC (rev 537)
@@ -1,4 +1,11 @@
 2012-10-28  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/extconf.rb: Use rb_thread_call_without_gvl only when
+	    ruby/thread.h exists. rb_thread_call_without_gvl is an internal
+	    function in ruby 1.9.2 and 1.9.3.
+	* ext/oci8/oci8lib.c: fix compilation errors when ruby <= 1.9.1.
+	* setup.rb: fix uninitialized constant Config (NameError) on ruby 1.8.7.
+
+2012-10-28  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/lob.c, ext/oci8/oci8.c, ext/oci8/oci8.h, ext/oci8/oci8lib.c:
 	    Fix SEGV when a temporary LOB is GCed while another LOB is read.
 	    (github issue #20 reported by techsplicer)

Modified: trunk/ruby-oci8/ext/oci8/extconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/extconf.rb	2012-10-28 04:51:34 UTC (rev 536)
+++ trunk/ruby-oci8/ext/oci8/extconf.rb	2012-10-28 05:52:44 UTC (rev 537)
@@ -120,7 +120,7 @@
 have_func("rb_set_end_proc", "ruby.h")
 have_func("rb_class_superclass", "ruby.h")
 have_func("rb_thread_blocking_region", "ruby.h")
-have_func("rb_thread_call_without_gvl", "ruby.h")
+have_func("rb_thread_call_without_gvl", "ruby/thread.h")
 
 # replace files
 replace = {

Modified: trunk/ruby-oci8/ext/oci8/oci8.h
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8.h	2012-10-28 04:51:34 UTC (rev 536)
+++ trunk/ruby-oci8/ext/oci8/oci8.h	2012-10-28 05:52:44 UTC (rev 537)
@@ -348,7 +348,7 @@
     rb_pid_t pid;
     unsigned char state;
     char is_autocommit;
-#ifdef HAVE_RB_THREAD_BLOCKING_REGION
+#ifdef NATIVE_THREAD_WITH_GVL
     char non_blocking;
 #endif
     VALUE long_read_len;

Modified: trunk/ruby-oci8/ext/oci8/oci8lib.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8lib.c	2012-10-28 04:51:34 UTC (rev 536)
+++ trunk/ruby-oci8/ext/oci8/oci8lib.c	2012-10-28 05:52:44 UTC (rev 537)
@@ -253,7 +253,7 @@
 #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL
             rv = (sword)(VALUE)rb_thread_call_without_gvl(free_temp_lob, &arg, oci8_unblock_func, svcctx);
 #else
-            rv = (sword)rb_thread_blocking_region(free_temp_lob, &arg, oci8_unblock_func, svcctx);
+            rv = (sword)rb_thread_blocking_region((VALUE(*)(void*))free_temp_lob, &arg, oci8_unblock_func, svcctx);
 #endif
             if (rv == OCI_ERROR) {
                 if (oci8_get_error_code(errhp) == 1013) {
@@ -277,7 +277,7 @@
 #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL
         rv = (sword)(VALUE)rb_thread_call_without_gvl(func, data, oci8_unblock_func, svcctx);
 #else
-        rv = (sword)rb_thread_blocking_region(func, (rb_blocking_function_t)data, oci8_unblock_func, svcctx);
+        rv = (sword)rb_thread_blocking_region((VALUE(*)(void*))func, data, oci8_unblock_func, svcctx);
 #endif
         if (rv == OCI_ERROR) {
             if (oci8_get_error_code(errhp) == 1013) {

Modified: trunk/ruby-oci8/setup.rb
===================================================================
--- trunk/ruby-oci8/setup.rb	2012-10-28 04:51:34 UTC (rev 536)
+++ trunk/ruby-oci8/setup.rb	2012-10-28 05:52:44 UTC (rev 537)
@@ -72,8 +72,6 @@
   end
 end
 
-RbConfig = Config unless defined? RbConfig
-
 #
 # Application independent utilities
 #
@@ -101,6 +99,8 @@
   require 'rbconfig'
 end
 
+RbConfig = Config unless defined? RbConfig
+
 def multipackage_install?
   FileTest.directory?(File.dirname($0) + '/packages')
 end



More information about the ruby-oci8-commit mailing list