summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-time/src
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-time/src')
-rw-r--r--mrbgems/mruby-time/src/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c
index 2a4347b7c..b9746b79e 100644
--- a/mrbgems/mruby-time/src/time.c
+++ b/mrbgems/mruby-time/src/time.c
@@ -11,6 +11,16 @@
#include <mruby/class.h>
#include <mruby/data.h>
+#if _MSC_VER < 1800
+double round(double x) {
+ if (x >= 0.0) {
+ return (double)((int)(x + 0.5));
+ } else {
+ return (double)((int)(x - 0.5));
+ }
+}
+#endif
+
#if !defined(__MINGW64__) && defined(_WIN32)
# define llround(x) round(x)
#endif