Fix MSVC++ compile error caused by missing round() in math.h

This commit is contained in:
Mark Morschhäuser 2014-03-11 16:10:55 +01:00
parent 6e9f81461a
commit 80da61dcbb
8 changed files with 37 additions and 6 deletions

12
cockatrice/src/round.h Normal file
View file

@ -0,0 +1,12 @@
#ifndef MSVC_ROUND_FIX
#define MSVC_ROUND_FIX
/**
* This helper function exists only because MS VC++ 2010 does not support round() in
* <cmath>. round() works with g++ and clang++ but is formally a C++11 extension.
* So this file exists for MS VC++ only.
*/
inline double round(double val) {
return floor(val + 0.5);
}
#endif /* MSVC_ROUND_FIX */