summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/dl/lib/dl/types.rb10
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b34735b..e288d05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Feb 9 11:32:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/types.rb: Win64 support.
+
Thu Feb 9 04:12:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
* test/pathname/test_pathname.rb: not read but binread.
diff --git a/ext/dl/lib/dl/types.rb b/ext/dl/lib/dl/types.rb
index c79f74f..3dfa408 100644
--- a/ext/dl/lib/dl/types.rb
+++ b/ext/dl/lib/dl/types.rb
@@ -7,6 +7,8 @@ module DL
# * BOOL
# * BYTE
# * DWORD
+ # * DWORD32
+ # * DWORD64
# * HANDLE
# * HDC
# * HINSTANCE
@@ -27,6 +29,8 @@ module DL
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 @@ module DL
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*"