diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2010-01-24 15:44:13 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2010-01-24 15:44:36 +0100 |
commit | ce1dfc7b2b423113e9b2eebc9fe07436f4110a8e (patch) | |
tree | 6dbd8d86b037bd349d764a9ac1d4289c11351b69 /crawl-ref/source/msvc.h | |
parent | 6b0ad0f051fa8945114d66d4d5a02bfc5554f493 (diff) | |
download | crawl-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.h | 7 |
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) */ |