]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix compilation of wxVariant code with VC6.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 May 2012 14:24:07 +0000 (14:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 May 2012 14:24:07 +0000 (14:24 +0000)
This was broken by the changes in r71196 as the original VC6 SDK doesn't
define VARIANT::llVal.

See #14210.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/ole/oleutils.cpp

index 00de18484e28341d156f1a1016f1b9d3699ed1c3..0ba95fc800ca6589d5138b9e9fdeb6852bcace02 100644 (file)
@@ -148,7 +148,13 @@ WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& ole
         oleVariant.vt = VT_I4;
         oleVariant.lVal = variant.GetLong() ;
     }
-#if wxUSE_LONGLONG
+    // Original VC6 came with SDK too old to contain VARIANT::llVal declaration
+    // and there doesn't seem to be any way to test for it as Microsoft simply
+    // added it to the later version of oaidl.h without changing anything else.
+    // So assume it's not present for VC6, even though it might be if an
+    // updated SDK is used. In this case the user would need to disable this
+    // check himself.
+#if wxUSE_LONGLONG && !defined(__VISUALC6__)
     else if (type == wxT("longlong"))
     {
         oleVariant.vt = VT_I8;
@@ -357,7 +363,8 @@ wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
 #endif // wxUSE_DATETIME
                 break;
 
-#if wxUSE_LONGLONG
+                // See the comment before the __VISUALC6__ test above.
+#if wxUSE_LONGLONG && !defined(__VISUALC6__)
             case VT_I8:
                 variant = wxLongLong(oleVariant.llVal);
                 break;