From: Jaakko Salli Date: Mon, 19 Apr 2010 14:25:41 +0000 (+0000) Subject: When deciding whether to convert wxAny to 'long' or 'longlong' wxVariant, use wxINT32... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4403de7616c104948868f3564fb253a49b1d222e 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 --- diff --git a/src/common/any.cpp b/src/common/any.cpp index a50349800c..69bb19c143 100644 --- a/src/common/any.cpp +++ b/src/common/any.cpp @@ -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();