OpenXcom Forum

Contributions => Programming => Topic started by: sir_nacnud on September 29, 2010, 03:04:50 am

Title: Fixed build error with r146
Post by: sir_nacnud on September 29, 2010, 03:04:50 am
MovingTarget.cpp needed cmath included for sqrt().  Attached patch fixes this.

I noticed you had defined PI yourself in a couple of places in the code.  There is a define for PI in cmath, called M_PI.  Just a heads up in case you didn't know about it.
Title: Re: Fixed build error with r146
Post by: SupSuper on September 29, 2010, 01:26:09 pm
M_PI is not standard and I don't think it's included in VC++.
Title: Re: Fixed build error with r146
Post by: SupSuper on September 29, 2010, 10:10:43 pm
Fixed, apparently I needed to add:
#define _USE_MATH_DEFINES
So I just replaced one define with another, but consistency and all that. :P
Title: Re: Fixed build error with r146
Post by: sir_nacnud on September 30, 2010, 02:06:10 am
Why not make _USE_MATH_DEFINES a compiler define so you don't have to define it each time you want to use M_PI?