summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-13 00:03:11 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-13 00:03:11 +0000
commit80a5a3f9dca3e7e073f3e14a02c4873c30db0f0e (patch)
treeacfc4fff56ed73531840e7f5db008faf3c8ea392 /ext/win32ole
parent9ed35ae7930c57b63b218cda716fcf01aa56ac88 (diff)
* ext/win32ole/win32ole.c (load_conv_function51932): support
CP51932 on cygwin and mingw32. thanks to arton. * test/win32ole/test_win32ole.rb (test_cp51932): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index d5dfc94..c6db9e0 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -82,6 +82,15 @@
#define V_UINTREF(X) V_UNION(X, puintVal)
#endif
+/*
+ * unfortunately IID_IMultiLanguage2 is not included in any libXXX.a
+ * in Cygwin(mingw32).
+ */
+#if defined(__CYGWIN__) || defined(__MINGW32__)
+#undef IID_IMultiLanguage2
+const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}};
+#endif
+
#define OLE_RELEASE(X) (X) ? ((X)->lpVtbl->Release(X)) : 0
#define OLE_ADDREF(X) (X) ? ((X)->lpVtbl->AddRef(X)) : 0
@@ -119,7 +128,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.3.5"
+#define WIN32OLE_VERSION "1.3.6"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -965,15 +974,8 @@ load_conv_function51932()
HRESULT hr;
void *p;
if (!pIMultiLanguage2) {
-#ifdef _MSC_VER
hr = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER,
&IID_IMultiLanguage2, &p);
-#else
- /*
- * unfortunately, fail to link IID_IMultiLanguage2 on Cygwin or mingw32.
- */
- hr = E_FAIL;
-#endif
if (FAILED(hr)) {
rb_raise(eWIN32OLERuntimeError, "fail to load convert function for CP51932");
}