[ruby-oci8-commit] [322] trunk/ruby-oci8/ext/oci8: * oraconf.rb: fix big/ little endian checking problem on Mac OS X ppc.

nobody at rubyforge.org nobody at rubyforge.org
Wed Mar 11 09:11:09 EDT 2009


Revision: 322
Author:   kubo
Date:     2009-03-11 09:11:08 -0400 (Wed, 11 Mar 2009)

Log Message:
-----------
* oraconf.rb: fix big/little endian checking problem on Mac OS X ppc.
    (contributed by unknown. See: Bug ID 24284 on rubyforge.)

Modified Paths:
--------------
    branches/ruby-oci8-1.0/ChangeLog
    branches/ruby-oci8-1.0/ext/oci8/oraconf.rb
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/oraconf.rb

Modified: branches/ruby-oci8-1.0/ChangeLog
===================================================================
--- branches/ruby-oci8-1.0/ChangeLog	2009-02-15 14:58:37 UTC (rev 321)
+++ branches/ruby-oci8-1.0/ChangeLog	2009-03-11 13:11:08 UTC (rev 322)
@@ -1,3 +1,7 @@
+2009-03-11  KUBO Takehiro  <kubo at jiubao.org>
+	* oraconf.rb: fix big/little endian checking problem on Mac OS X ppc.
+	    (contributed by unknown. See: Bug ID 24284 on rubyforge.)
+
 2009-02-08  KUBO Takehiro  <kubo at jiubao.org>
 	* NEWS: add changes between 1.0.3 and 1.0.4.
 	* VERSION: change version to 1.0.4.

Modified: branches/ruby-oci8-1.0/ext/oci8/oraconf.rb
===================================================================
--- branches/ruby-oci8-1.0/ext/oci8/oraconf.rb	2009-02-15 14:58:37 UTC (rev 321)
+++ branches/ruby-oci8-1.0/ext/oci8/oraconf.rb	2009-03-11 13:11:08 UTC (rev 322)
@@ -425,7 +425,7 @@
       so_ext = 'dylib'
       check_proc = Proc.new do |file|
         is_32bit = [0].pack('l!').size == 4
-        is_big_endian = "\x01\x02".unpack('s') == 0x0102
+        is_big_endian = "\x01\x02".unpack('s')[0] == 0x0102
         if is_32bit
           if is_big_endian
             this_cpu = :ppc    # 32-bit big-endian
@@ -444,7 +444,12 @@
           if so.cpu.include? this_cpu
             true
           else
-            puts "  skip: #{file} is for #{so.cpu} cpu."
+            if so.cpu.size > 1
+              arch_types = so.cpu[0..-2].join(', ') + ' and ' + so.cpu[-1].to_s
+            else
+              arch_types = so.cpu[0]
+            end
+            puts "  skip: #{file} is for #{arch_types} cpu."
             false
           end
         else

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2009-02-15 14:58:37 UTC (rev 321)
+++ trunk/ruby-oci8/ChangeLog	2009-03-11 13:11:08 UTC (rev 322)
@@ -1,3 +1,7 @@
+2009-03-11  KUBO Takehiro  <kubo at jiubao.org>
+	* oraconf.rb: fix big/little endian checking problem on Mac OS X ppc.
+	    (contributed by unknown. See: Bug ID 24284 on rubyforge.)
+
 2009-02-15  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/ocidatetime.c: fix array DML and DateTime object problem.
 	    OCI8::Cursor#bind_param_array(key, array_of_datetime) didn't

Modified: trunk/ruby-oci8/ext/oci8/oraconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/oraconf.rb	2009-02-15 14:58:37 UTC (rev 321)
+++ trunk/ruby-oci8/ext/oci8/oraconf.rb	2009-03-11 13:11:08 UTC (rev 322)
@@ -425,7 +425,7 @@
       so_ext = 'dylib'
       check_proc = Proc.new do |file|
         is_32bit = [0].pack('l!').size == 4
-        is_big_endian = "\x01\x02".unpack('s') == 0x0102
+        is_big_endian = "\x01\x02".unpack('s')[0] == 0x0102
         if is_32bit
           if is_big_endian
             this_cpu = :ppc    # 32-bit big-endian
@@ -444,7 +444,12 @@
           if so.cpu.include? this_cpu
             true
           else
-            puts "  skip: #{file} is for #{so.cpu} cpu."
+            if so.cpu.size > 1
+              arch_types = so.cpu[0..-2].join(', ') + ' and ' + so.cpu[-1].to_s
+            else
+              arch_types = so.cpu[0]
+            end
+            puts "  skip: #{file} is for #{arch_types} cpu."
             false
           end
         else




More information about the ruby-oci8-commit mailing list