X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77b239d4ba3333c2313035a3ea1ca9ff5d6cdb0f..9c805dec6caf3c98a3797898cffe795b5b56e606:/include/wx/longlong.h diff --git a/include/wx/longlong.h b/include/wx/longlong.h index de468676fd..f248bb6d21 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -404,14 +404,23 @@ public: // convert to ulong with range checking in debug mode (only!) unsigned long ToULong() const { - wxASSERT_MSG( m_ll <= LONG_MAX, + wxASSERT_MSG( m_ll <= ULONG_MAX, wxT("wxULongLong to long conversion loss of precision") ); return wx_truncate_cast(unsigned long, m_ll); } // convert to double + // + // For some completely obscure reasons compiling the cast below with + // VC6 in DLL builds only (!) results in "error C2520: conversion from + // unsigned __int64 to double not implemented, use signed __int64" so + // we must use a different version for that compiler. +#ifdef __VISUALC6__ + double ToDouble() const; +#else double ToDouble() const { return wx_truncate_cast(double, m_ll); } +#endif // operations // addition @@ -1077,6 +1086,12 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &st #if wxUSE_LONGLONG_NATIVE +// VC6 is known to not have __int64 specializations of numeric_limits<> in its +// anyhow so don't bother including it, especially as it results in +// tons of warnings because the standard header itself uses obsolete template +// specialization syntax. +#ifndef __VISUALC6__ + #include namespace std @@ -1094,6 +1109,8 @@ template<> class numeric_limits } // namespace std +#endif // !VC6 + #endif // wxUSE_LONGLONG_NATIVE #endif // wxUSE_LONGLONG