simulationcraft / simc

Simulationcraft engine/GUI
GNU General Public License v3.0
1.4k stars 693 forks source link

Compilation errors in Visual Studio (Cata branch) #318

Closed navv1234 closed 9 years ago

navv1234 commented 9 years ago

Originally reported on Google Code with ID 319

What steps will reproduce the problem?
1. Compile the Cata branch in Visual Studio.

In sc_priest.cpp, line 714, 1580 and 1788.
"error C3861: 'round': identifier not found"

Reported by khelataar on 2010-08-26 07:12:19

navv1234 commented 9 years ago
These lines are from my code, testing the new dot haste scaling.

I'm not sure why Visual Studio doesn't accept/compile the standard function "round".
Mingw32 does just fine, and other standard functions like "floor" also seem to be working
fine with Visual Studio (otherwise you would have gotten a lot more error's).

Reported by philoptik on 2010-08-26 08:25:01

navv1234 commented 9 years ago
I'm not sure which standard(s) specify round().

Looking at the math functions at 

http://www.cplusplus.com/reference/clibrary/cmath/

there is no round(), although floor() and ceil() are present.

gnuc has round() in math.h, but the gnuc library is a superset of ANSI.  I don't know
if you get round() if you compile with -ansi.

Reported by Erdluf on 2010-08-26 13:13:24

navv1234 commented 9 years ago
Just stick with:  floor( x + 0.5 )

Reported by natehieter on 2010-08-26 13:39:46

navv1234 commented 9 years ago
fixed in r4655

Reported by philoptik on 2010-08-26 14:24:08