aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-01-23 16:28:07 +0100
committerBjörn-Egil Dahlberg <[email protected]>2013-01-23 16:28:07 +0100
commitd0809964a228c6314a5bb8b5872114a0ab9ec65e (patch)
treea2eae1bff3f1fb677f7c26e30c3d9a244c871fb9
parenta5c2217360654969a118862cc95157db90755272 (diff)
parentab462a0e475f8b3696289e7b7b11e56b8e0b07c2 (diff)
downloadotp-d0809964a228c6314a5bb8b5872114a0ab9ec65e.tar.gz
otp-d0809964a228c6314a5bb8b5872114a0ab9ec65e.tar.bz2
otp-d0809964a228c6314a5bb8b5872114a0ab9ec65e.zip
Merge branch 'egil/fix-win-float-exponent/OTP-10751'
* egil/fix-win-float-exponent/OTP-10751: erts: Force windows to use two-digit exponent
-rw-r--r--erts/emulator/beam/erl_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 516f7b3cb3..b518683730 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -1532,6 +1532,14 @@ erl_start(int argc, char **argv)
i++;
}
+/* Output format on windows for sprintf defaults to three exponents.
+ * We use two-exponent to mimic normal sprintf behaviour.
+ */
+
+#if defined(__WIN32__) && defined(_TWO_DIGIT_EXPONENT)
+ _set_output_format(_TWO_DIGIT_EXPONENT);
+#endif
+
/* Restart will not reinstall the break handler */
#ifdef __WIN32__
if (ignore_break)