X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223d09f6b523aac674ef9b72a883dfa8d37c5d4e..54ca0d120a10e57b7f2c75269a136e4a68508447:/src/msw/ole/automtn.cpp diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 75a049fbcf..9ea5f213aa 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -20,15 +20,19 @@ #pragma hdrstop #endif -#include "wx/log.h" +#include "wx/defs.h" -#include -#include +// Watcom C++ gives a linker error if this is compiled in. +// With Borland C++, all samples crash if this is compiled in. +#if !defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) +#include "wx/log.h" #include "wx/msw/ole/automtn.h" - #include "wx/msw/private.h" +#include +#include + #include #include #include @@ -551,6 +555,8 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) oleVariant.vt = VT_BSTR; oleVariant.bstrVal = ConvertStringToOle(str); } +// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled +#if wxUSE_TIMEDATE && !defined(__WATCOMC__) else if (type == wxT("date")) { wxDate date( variant.GetDate() ); @@ -569,6 +575,7 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) time.GetHour(), time.GetMinute(), time.GetSecond(), oleVariant.date)) return FALSE; } +#endif else if (type == wxT("void*")) { oleVariant.vt = VT_DISPATCH; @@ -644,7 +651,8 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) } case VT_DATE: { - struct tm tmTemp; +#if wxUSE_TIMEDATE + struct tm tmTemp; if (!TmFromOleDate(oleVariant.date, tmTemp)) return FALSE; @@ -652,7 +660,9 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) wxTime time(date, tmTemp.tm_hour, tmTemp.tm_min, tmTemp.tm_sec); variant = time; - break; +#endif + + break; } case VT_I4: { @@ -673,8 +683,12 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) #else variant = (bool) (oleVariant.bool != 0); #endif +#else +#ifndef HAVE_BOOL // Can't use bool operator if no native bool type + variant = (long) (oleVariant.boolVal != 0); #else variant = (bool) (oleVariant.boolVal != 0); +#endif #endif break; } @@ -1159,3 +1173,5 @@ void ShowException(LPOLESTR szMember, HRESULT hr, EXCEPINFO *pexcep, unsigned in #endif +#endif // __WATCOMC__ +