windows: Call _set_output_format() only on Visual Studio versions 2013 or lower.

Since VS2015, float formatting is C standard compliant by default:
https://msdn.microsoft.com/en-us/library/bb531344(v=vs.140).aspx
This commit is contained in:
omtinez 2015-10-29 19:17:19 -07:00 committed by Paul Sokolovsky
parent 17c649da3d
commit 3510499a9e
1 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,9 @@ void init() {
init_sleep(); init_sleep();
#ifdef __MINGW32__ #ifdef __MINGW32__
putenv("PRINTF_EXPONENT_DIGITS=2"); putenv("PRINTF_EXPONENT_DIGITS=2");
#else #elif _MSC_VER < 1900
// This is only necessary for Visual Studio versions 2013 and below:
// https://msdn.microsoft.com/en-us/library/bb531344(v=vs.140).aspx
_set_output_format(_TWO_DIGIT_EXPONENT); _set_output_format(_TWO_DIGIT_EXPONENT);
#endif #endif
} }