summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-11 22:59:51 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-11 22:59:51 +0000
commit92a7da1900323139bb678dcde62a8c821cf301f9 (patch)
treefac13dcc5c52e7196998c1a98f2985052e6411d8
parentecd8abbda494187e547fe3b8c0e6d0217f50934a (diff)
* ext/win32ole/win32ole.c (ole_set_byref): support VT_UI8|VT_BYREF,
VT_I8|VT_BYREF in cygwin and mingw. * ext/win32ole/win32ole.c (ole_variant2val): ditto. * test/win32ole/test_win32ole_variant.rb (test_s_new_with_i8_byref): ditto. * test/win32ole/test_win32ole_variant.rb (test_s_new_with_ui8_byref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog13
-rw-r--r--ext/win32ole/win32ole.c16
-rw-r--r--test/win32ole/test_win32ole_variant.rb24
3 files changed, 31 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index e38ef24..4686d4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Sat Jan 12 07:52:47 2013 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_set_byref): support VT_UI8|VT_BYREF,
+ VT_I8|VT_BYREF in cygwin and mingw.
+
+ * ext/win32ole/win32ole.c (ole_variant2val): ditto.
+
+ * test/win32ole/test_win32ole_variant.rb (test_s_new_with_i8_byref):
+ ditto.
+
+ * test/win32ole/test_win32ole_variant.rb (test_s_new_with_ui8_byref):
+ ditto.
+
Sat Jan 12 02:45:00 2013 Zachary Scott <zachary@zacharyscott.net>
* man/ruby.1 (options): include --*-encoding from r38784
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index acc2fea..3d085e5 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -143,7 +143,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00,
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.5.3"
+#define WIN32OLE_VERSION "1.5.4"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -1816,14 +1816,18 @@ ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt)
V_R8REF(var) = &V_R8(realvar);
break;
-#if (_MSC_VER >= 1300)
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+#ifdef V_I8REF
case VT_I8:
V_I8REF(var) = &V_I8(realvar);
break;
+#endif
+#ifdef V_UI8REF
case VT_UI8:
V_UI8REF(var) = &V_UI8(realvar);
break;
#endif
+#endif
case VT_INT:
V_INTREF(var) = &V_INT(realvar);
break;
@@ -2179,8 +2183,10 @@ ole_variant2val(VARIANT *pvar)
#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
case VT_I8:
if(V_ISBYREF(pvar))
-#if (_MSC_VER >= 1300)
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+#ifdef V_I8REF
obj = I8_2_NUM(*V_I8REF(pvar));
+#endif
#else
obj = Qnil;
#endif
@@ -2189,8 +2195,10 @@ ole_variant2val(VARIANT *pvar)
break;
case VT_UI8:
if(V_ISBYREF(pvar))
-#if (_MSC_VER >= 1300)
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+#ifdef V_UI8REF
obj = UI8_2_NUM(*V_UI8REF(pvar));
+#endif
#else
obj = Qnil;
#endif
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index e6fddc9..26e72ea 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -255,28 +255,16 @@ if defined?(WIN32OLE_VARIANT)
assert_equal(WIN32OLE::VARIANT::VT_UINT|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
end
- # This test is failed in cygwin.
- # The tagVARIANT definition has no union member pllVal in cygwin.
def test_s_new_with_i8_byref
- if defined?(WIN32OLE::VARIANT::VT_I8) && /mswin/ =~ RUBY_PLATFORM
- obj = WIN32OLE_VARIANT.new(-123456789012345, WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(-123456789012345, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- else
- skip("WIN32OLE::VARIANT::VT_I8 is not available")
- end
+ obj = WIN32OLE_VARIANT.new(-123456789012345, WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF)
+ assert_equal(-123456789012345, obj.value)
+ assert_equal(WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
end
- # This test is failed in cygwin.
- # The tagVARIANT definition has no union member pullVal in cygwin.
def test_s_new_with_ui8_byref
- if defined?(WIN32OLE::VARIANT::VT_UI8) && /mswin/ =~ RUBY_PLATFORM
- obj = WIN32OLE_VARIANT.new(123456789012345, WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(123456789012345, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- else
- skip("WIN32OLE::VARIANT::VT_UI8 is not available")
- end
+ obj = WIN32OLE_VARIANT.new(123456789012345, WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF)
+ assert_equal(123456789012345, obj.value)
+ assert_equal(WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
end
def test_value