// Author: Jeffrey C. Ollie <jeff@ollie.clive.ia.us>, Vadim Zeitlin
// Modified by:
// Created: 10.02.99
-// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
}
// 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
inline wxLongLong operator-(unsigned long l, const wxULongLong& ull)
{
wxULongLong ret = wxULongLong(l) - ull;
- return wxLongLong((long)ret.GetHi(),ret.GetLo());
+ return wxLongLong((wxInt32)ret.GetHi(),ret.GetLo());
}
#if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS
namespace std
{
-template<> class numeric_limits<wxLongLong>
- : public numeric_limits<wxLongLong_t>
-{
-};
-
-template<> class numeric_limits<wxULongLong>
- : public numeric_limits<wxULongLong_t>
-{
-};
+#ifdef __clang__
+ // libstdc++ (used by Clang) uses struct for numeric_limits; unlike gcc, clang
+ // warns about this
+ template<> struct numeric_limits<wxLongLong> : public numeric_limits<wxLongLong_t> {};
+ template<> struct numeric_limits<wxULongLong> : public numeric_limits<wxULongLong_t> {};
+#else
+ template<> class numeric_limits<wxLongLong> : public numeric_limits<wxLongLong_t> {};
+ template<> class numeric_limits<wxULongLong> : public numeric_limits<wxULongLong_t> {};
+#endif
} // namespace std
#endif // wxUSE_LONGLONG_NATIVE
+// ----------------------------------------------------------------------------
+// Specialize wxArgNormalizer to allow using wxLongLong directly with wx pseudo
+// vararg functions.
+// ----------------------------------------------------------------------------
+
+// Notice that this must be done here and not in wx/strvararg.h itself because
+// we can't include wx/longlong.h from there as this header itself includes
+// wx/string.h which includes wx/strvararg.h too, so to avoid the circular
+// dependencies we can only do it here (or add another header just for this but
+// it doesn't seem necessary).
+#include "wx/strvararg.h"
+
+template<>
+struct WXDLLIMPEXP_BASE wxArgNormalizer<wxLongLong>
+{
+ wxArgNormalizer(wxLongLong value,
+ const wxFormatString *fmt, unsigned index)
+ : m_value(value)
+ {
+ wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_LongLongInt );
+ }
+
+ wxLongLong_t get() const { return m_value.GetValue(); }
+
+ wxLongLong m_value;
+};
+
#endif // wxUSE_LONGLONG
#endif // _WX_LONGLONG_H