[Bf-committers] last modifs in GHOST_WindowWin32.cpp : "M_PI" is an unknew var for MSVC tools

Stephen Swaney sswaney at centurytel.net
Sun Nov 12 18:10:44 CET 2006


On Sun, Nov 12, 2006 at 05:25:19PM +0100, jean-michel soler wrote:
> in 
> http://projects.blender.org/viewcvs/viewcvs.cgi/blender/intern/ghost/intern/GHOST_WindowWin32.cpp.diff?r1=1.12&r2=1.13&cvsroot=bf-blender
> 
> /* convert raw fixed point data to radians */
>  	                                                 altRad = 
> (fabs((float)ort.orAltitude)/(float)m_maxAltitude) * M_PI/2.0;
>  	                                                 azmRad = 
> ((float)ort.orAzimuth/(float)m_maxAzimuth) * M_PI*2.0;


M_PI is a *very* common constant in math code.

One one hand I'm stunned M_PI is not defined automagically
and on the other, this being msvc, I'm not suprised.

A little googling turns up this solution.

 #ifdef WIN32
 #define _USE_MATH_DEFINES
 #endif

-- 
Stephen Swaney			
sswaney at centurytel.net



More information about the Bf-committers mailing list