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

ruby-changes:22455

From: usa <ko1@a...>
Date: Thu, 9 Feb 2012 11:33:13 +0900 (JST)
Subject: [ruby-changes:22455] usa:r34504 (trunk): * ext/dl/lib/types.rb: Win64 support.

usa	2012-02-09 11:32:58 +0900 (Thu, 09 Feb 2012)

  New Revision: 34504

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

  Log:
    * ext/dl/lib/types.rb: Win64 support.

  Modified files:
    trunk/ChangeLog
    trunk/ext/dl/lib/dl/types.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34503)
+++ ChangeLog	(revision 34504)
@@ -1,3 +1,7 @@
+Thu Feb  9 11:32:36 2012  NAKAMURA Usaku  <usa@r...>
+
+	* ext/dl/lib/types.rb: Win64 support.
+
 Thu Feb  9 04:12:29 2012  NARUSE, Yui  <naruse@r...>
 
 	* test/pathname/test_pathname.rb: not read but binread.
Index: ext/dl/lib/dl/types.rb
===================================================================
--- ext/dl/lib/dl/types.rb	(revision 34503)
+++ ext/dl/lib/dl/types.rb	(revision 34504)
@@ -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*"

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

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