summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/msvc.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-01-24 15:44:13 +0100
committerRobert Vollmert <rvollmert@gmx.net>2010-01-24 15:44:36 +0100
commitce1dfc7b2b423113e9b2eebc9fe07436f4110a8e (patch)
tree6dbd8d86b037bd349d764a9ac1d4289c11351b69 /crawl-ref/source/msvc.h
parent6b0ad0f051fa8945114d66d4d5a02bfc5554f493 (diff)
downloadcrawl-ref-ce1dfc7b2b423113e9b2eebc9fe07436f4110a8e.tar.gz
crawl-ref-ce1dfc7b2b423113e9b2eebc9fe07436f4110a8e.zip
Provide an implementation of round() for MSVC.
Should hopefully fix the compile.
Diffstat (limited to 'crawl-ref/source/msvc.h')
-rw-r--r--crawl-ref/source/msvc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/msvc.h b/crawl-ref/source/msvc.h
index b929f53fc8..9cffc252a5 100644
--- a/crawl-ref/source/msvc.h
+++ b/crawl-ref/source/msvc.h
@@ -63,6 +63,13 @@ DIR* opendir(const char* path);
dirent* readdir(DIR*);
int closedir(DIR*);
+inline double round(double x)
+{
+ if (x >= 0.0)
+ return floor(x + 0.5);
+ else
+ return ceil(x - 0.5);
+}
#endif /* defined(TARGET_COMPILER_VC) */