mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
wxWidgets3: update to svn r70933
This commit is contained in:
73
Externals/wxWidgets3/include/wx/longlong.h
vendored
73
Externals/wxWidgets3/include/wx/longlong.h
vendored
@ -5,7 +5,7 @@
|
||||
// Author: Jeffrey C. Ollie <jeff@ollie.clive.ia.us>, Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 10.02.99
|
||||
// RCS-ID: $Id: longlong.h 61508 2009-07-23 20:30:22Z VZ $
|
||||
// RCS-ID: $Id: longlong.h 68472 2011-07-31 13:25:33Z VS $
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -404,15 +404,20 @@ 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
|
||||
#ifdef _MSC_VER
|
||||
double ToDouble() const { return wx_truncate_cast(double, (__int64) m_ll); }
|
||||
//
|
||||
// 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
|
||||
@ -1075,6 +1080,66 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &st
|
||||
|
||||
#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
|
||||
|
||||
#endif // _WX_LONGLONG_H
|
||||
|
Reference in New Issue
Block a user