+#if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS
+
+WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxULongLong_t value);
+WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxLongLong_t value);
+
+WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxULongLong_t &value);
+WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxLongLong_t &value);
+
+#endif
+
+// ----------------------------------------------------------------------------
+// Specialize numeric_limits<> for our long long wrapper classes.
+// ----------------------------------------------------------------------------
+
+#if wxUSE_LONGLONG_NATIVE
+
+// VC6 is known to not have __int64 specializations of numeric_limits<> in its
+// <limits> 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 <limits>
+
+namespace std
+{
+
+#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 // !VC6
+
+#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
+