X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c24ca50d6d41f93d5c21e568e759f6382d61c09..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/longlong.h?ds=sidebyside diff --git a/include/wx/longlong.h b/include/wx/longlong.h index f248bb6d21..19c580110e 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -1097,15 +1097,15 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &st namespace std { -template<> class numeric_limits - : public numeric_limits -{ -}; - -template<> class numeric_limits - : public numeric_limits -{ -}; +#ifdef __clang__ + // libstdc++ (used by Clang) uses struct for numeric_limits; unlike gcc, clang + // warns about this + template<> struct numeric_limits : public numeric_limits {}; + template<> struct numeric_limits : public numeric_limits {}; +#else + template<> class numeric_limits : public numeric_limits {}; + template<> class numeric_limits : public numeric_limits {}; +#endif } // namespace std @@ -1113,6 +1113,33 @@ template<> class numeric_limits #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 +{ + 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