aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-01-22 18:26:29 +0100
committerBjörn-Egil Dahlberg <[email protected]>2013-01-22 18:26:29 +0100
commitab462a0e475f8b3696289e7b7b11e56b8e0b07c2 (patch)
tree384921dc2df93a0163471eb82a551a72b9ba1639 /erts
parent9b01d9553434256b93b4899caf042d857f6ef068 (diff)
downloadotp-ab462a0e475f8b3696289e7b7b11e56b8e0b07c2.tar.gz
otp-ab462a0e475f8b3696289e7b7b11e56b8e0b07c2.tar.bz2
otp-ab462a0e475f8b3696289e7b7b11e56b8e0b07c2.zip
erts: Force windows to use two-digit exponent
sprintf on windows uses a three-digit exponent default
Diffstat (limited to 'erts')
-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 8cdf954dd2..44735ba425 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -1520,6 +1520,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)