Use dedicated CRT function to round the value for MSVS 2015+
round() is available since at least VS 2015. It is not available in VS 2010. VS 2012 and 13 need to be checked.
This commit is contained in:
@@ -117,7 +117,7 @@
|
|||||||
wxASSERT_MSG(x > (double)INT_MIN - 0.5 && x < (double)INT_MAX + 0.5,
|
wxASSERT_MSG(x > (double)INT_MIN - 0.5 && x < (double)INT_MAX + 0.5,
|
||||||
wxT("argument out of supported range"));
|
wxT("argument out of supported range"));
|
||||||
|
|
||||||
#if defined(HAVE_ROUND) || defined(__VISUALC__)
|
#if defined(HAVE_ROUND) || wxCHECK_VISUALC_VERSION(14)
|
||||||
return int(round(x));
|
return int(round(x));
|
||||||
#else
|
#else
|
||||||
return (int)(x < 0 ? x - 0.5 : x + 0.5);
|
return (int)(x < 0 ? x - 0.5 : x + 0.5);
|
||||||
|
Reference in New Issue
Block a user