summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-12 22:54:23 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-12 22:54:23 +0000
commitd5c2261bd600d587f0b4433fcdf457160defbfca (patch)
treef5d1dee0dbda1ab7a041b3cacb602a9585375a14 /ext
parentbfe6bd0f72a58196969ad7dbdf409fe4573c5eea (diff)
* ext/win32ole/win32ole.c (ole_val2variant): fix integer conversion in
cygwin64. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/win32ole/win32ole.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 229780d565c..dbed05f8e55 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -26,7 +26,7 @@
const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}};
#endif
-#define WIN32OLE_VERSION "1.8.4"
+#define WIN32OLE_VERSION "1.8.5"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -1269,8 +1269,14 @@ ole_val2variant(VALUE val, VARIANT *var)
V_BSTR(var) = ole_vstr2wc(val);
break;
case T_FIXNUM:
- V_VT(var) = VT_I4;
- V_I4(var) = NUM2INT(val);
+ V_I4(var) = NUM2LONG(val);
+ if (V_I4(var) == NUM2LONG(val)) {
+ V_VT(var) = VT_I4;
+ }
+ else {
+ V_I8(var) = NUM2LONG(val);
+ V_VT(var) = VT_I8;
+ }
break;
case T_BIGNUM:
V_VT(var) = VT_R8;