When deciding whether to convert wxAny to 'long' or 'longlong' wxVariant, use wxINT32_MAX instead of LONG_MAX (for more consistent results across builds)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2010-04-19 14:25:41 +00:00
parent fdfd64994c
commit 4403de7616

View File

@ -172,7 +172,10 @@ bool wxConvertAnyToVariant(const wxAny& any, wxVariant* variant)
wxLongLong_t ll = 0;
if ( any.GetAs(&ll) )
{
if ( ll > LONG_MAX )
// NB: Do not use LONG_MAX here. Explicitly using 32-bit
// integer constraint yields more consistent behavior across
// builds.
if ( ll > wxINT32_MAX or ll < wxINT32_MIN )
*variant = wxLongLong(ll);
else
*variant = (long) wxLongLong(ll).GetLo();