[GRASS5] r.flow: strange compile error M_PI
Markus Neteler
neteler at itc.it
Tue Jun 28 07:37:53 EDT 2005
On Tue, Jun 28, 2005 at 12:27:55PM +0100, Glynn Clements wrote:
>
> Brad Douglas 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?
Markus
More information about the grass-dev
mailing list