mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
Fix MSVC++ compile error caused by missing round() in math.h
This commit is contained in:
parent
6e9f81461a
commit
80da61dcbb
8 changed files with 37 additions and 6 deletions
12
cockatrice/src/round.h
Normal file
12
cockatrice/src/round.h
Normal 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 */
|
||||
Loading…
Add table
Add a link
Reference in a new issue