[前][次][番号順一覧][スレッド一覧]

ruby-changes:22460

From: naruse <ko1@a...>
Date: Thu, 9 Feb 2012 16:21:05 +0900 (JST)
Subject: [ruby-changes:22460] naruse:r34509 (ruby_1_9_3): merge revision(s) 34504,34506,34507,34508:

naruse	2012-02-09 16:20:53 +0900 (Thu, 09 Feb 2012)

  New Revision: 34509

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34509

  Log:
    merge revision(s) 34504,34506,34507,34508:
    
    * ext/dl/lib/types.rb: Win64 support.
    
    * ext/fiddle/conversions.c (value_to_generic): src is not guranteed as
      a Bignum if the type is LONG_LONG.  it may be a Fixnum if the value
      is small.
    
    * ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
      currenly pack/unpack does not accept "q!" and "Q!".
    
    * test/ruby/memory_status.rb (Memory::Win32): 64bit support.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/dl/lib/dl/types.rb
    branches/ruby_1_9_3/ext/dl/lib/dl/value.rb
    branches/ruby_1_9_3/ext/fiddle/conversions.c
    branches/ruby_1_9_3/test/ruby/memory_status.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 34508)
+++ ruby_1_9_3/ChangeLog	(revision 34509)
@@ -1,3 +1,22 @@
+Thu Feb  9 16:19:04 2012  NAKAMURA Usaku  <usa@r...>
+
+	* test/ruby/memory_status.rb (Memory::Win32): 64bit support.
+
+Thu Feb  9 16:19:04 2012  NAKAMURA Usaku  <usa@r...>
+
+	* ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
+	  currenly pack/unpack does not accept "q!" and "Q!".
+
+Thu Feb  9 16:19:04 2012  NAKAMURA Usaku  <usa@r...>
+
+	* ext/fiddle/conversions.c (value_to_generic): src is not guranteed as
+	  a Bignum if the type is LONG_LONG.  it may be a Fixnum if the value
+	  is small.
+
+Thu Feb  9 16:19:04 2012  NAKAMURA Usaku  <usa@r...>
+
+	* ext/dl/lib/types.rb: Win64 support.
+
 Thu Feb  9 11:11:15 2012  Hiroshi Shirosaki <h.shirosaki@g...>
 
 	* ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
Index: ruby_1_9_3/ext/dl/lib/dl/types.rb
===================================================================
--- ruby_1_9_3/ext/dl/lib/dl/types.rb	(revision 34508)
+++ ruby_1_9_3/ext/dl/lib/dl/types.rb	(revision 34509)
@@ -7,6 +7,8 @@
   # * BOOL
   # * BYTE
   # * DWORD
+  # * DWORD32
+  # * DWORD64
   # * HANDLE
   # * HDC
   # * HINSTANCE
@@ -27,6 +29,8 @@
       m.module_eval{
         typealias "DWORD", "unsigned long"
         typealias "PDWORD", "unsigned long *"
+        typealias "DWORD32", "unsigned long"
+        typealias "DWORD64", "unsigned long long"
         typealias "WORD", "unsigned short"
         typealias "PWORD", "unsigned short *"
         typealias "BOOL", "int"
@@ -36,7 +40,11 @@
         typealias "UINT", "unsigned int"
         typealias "ULONG", "unsigned long"
         typealias "UCHAR", "unsigned char"
-        typealias "HANDLE", "unsigned long"
+        if [nil].pack('p').bytesize == 8
+          typealias "HANDLE", "unsigned long long"
+        else
+          typealias "HANDLE", "unsigned long"
+        end
         typealias "PHANDLE", "void*"
         typealias "PVOID", "void*"
         typealias "LPCSTR", "char*"
Index: ruby_1_9_3/ext/dl/lib/dl/value.rb
===================================================================
--- ruby_1_9_3/ext/dl/lib/dl/value.rb	(revision 34508)
+++ ruby_1_9_3/ext/dl/lib/dl/value.rb	(revision 34509)
@@ -13,7 +13,7 @@
       when TYPE_LONG
         [val].pack("l!").unpack("L!")[0]
       when TYPE_LONG_LONG
-        [val].pack("q!").unpack("Q!")[0]
+        [val].pack("q").unpack("Q")[0]
       else
         val
       end
@@ -30,7 +30,7 @@
       when TYPE_LONG
         [val].pack("L!").unpack("l!")[0]
       when TYPE_LONG_LONG
-        [val].pack("Q!").unpack("q!")[0]
+        [val].pack("Q").unpack("q")[0]
       else
         val
       end
Index: ruby_1_9_3/ext/fiddle/conversions.c
===================================================================
--- ruby_1_9_3/ext/fiddle/conversions.c	(revision 34508)
+++ ruby_1_9_3/ext/fiddle/conversions.c	(revision 34509)
@@ -72,7 +72,7 @@
 	break;
 #if HAVE_LONG_LONG
       case TYPE_LONG_LONG:
-	dst->long_long = rb_big2ull(src);
+	dst->long_long = NUM2ULL(src);
 	break;
 #endif
       case TYPE_FLOAT:
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 34508)
+++ ruby_1_9_3/version.h	(revision 34509)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 73
+#define RUBY_PATCHLEVEL 74
 
 #define RUBY_RELEASE_DATE "2012-02-09"
 #define RUBY_RELEASE_YEAR 2012
Index: ruby_1_9_3/test/ruby/memory_status.rb
===================================================================
--- ruby_1_9_3/test/ruby/memory_status.rb	(revision 34508)
+++ ruby_1_9_3/test/ruby/memory_status.rb	(revision 34509)
@@ -22,7 +22,11 @@
       extend DL::Importer
       dlload "kernel32.dll", "psapi.dll"
       include DL::Win32Types
-      typealias "SIZE_T", "DWORD"
+      if [nil].pack('p').bytesize == 8
+        typealias "SIZE_T", "DWORD64"
+      else
+        typealias "SIZE_T", "DWORD32"
+      end
 
       PROCESS_MEMORY_COUNTERS = struct [
         "DWORD  cb",

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]