[GRASS5] r.flow: strange compile error M_PI

Glynn Clements glynn at gclements.plus.com
Wed Jun 29 08:02:24 EDT 2005


Markus Neteler wrote:

> > > Currently, "gmath.h" doesn't seem like the best place to define it, but
> > > it's not the worst, either.
> > 
> > It shouldn't go in gmath.h; that's for more "heavyweight" stuff.
> > 
> > > Personally, I would work this out via autoconf by doing something like:
> > > 
> > > ...
> > > AC_MSG_CHECKING(for M_PI) 
> > > mpi=no 
> > > AC_TRY_COMPILE([#include <math.h>], 
> > > [ double f = M_PI; ], 
> > > mpi=yes, AC_DEFINE(M_PI, 3.14159265358979323846)) 
> > > AC_MSG_RESULT($mpi)
> > 
> > Personally, I would just conditionalise the local definitions, e.g.:
> > 
> > 	#ifndef M_PI
> > 	#define M_PI 3.14159265358979323846
> > 	#endif
> 
> What about moving this condition to include/gis.h to avoid that (different)
> values are scattered around?

That seems reasonable enough.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list