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

ruby-changes:26735

From: suke <ko1@a...>
Date: Sat, 12 Jan 2013 08:00:04 +0900 (JST)
Subject: [ruby-changes:26735] suke:r38787 (trunk): * ext/win32ole/win32ole.c (ole_set_byref): support VT_UI8|VT_BYREF,

suke	2013-01-12 07:59:51 +0900 (Sat, 12 Jan 2013)

  New Revision: 38787

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

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole.c
    trunk/test/win32ole/test_win32ole_variant.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38786)
+++ ChangeLog	(revision 38787)
@@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 12 07:52:47 2013  Masaki Suketa <masaki.suketa@n...>
+
+	* 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@z...>
 
 	* man/ruby.1 (options): include --*-encoding from r38784
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 38786)
+++ ext/win32ole/win32ole.c	(revision 38787)
@@ -143,7 +143,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L143
 
 #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 https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1816
             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) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2183
 #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) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2195
         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
Index: test/win32ole/test_win32ole_variant.rb
===================================================================
--- test/win32ole/test_win32ole_variant.rb	(revision 38786)
+++ test/win32ole/test_win32ole_variant.rb	(revision 38787)
@@ -255,28 +255,16 @@ if defined?(WIN32OLE_VARIANT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variant.rb#L255
       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

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

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