[GRASS5] RE: [winGRASS] GRASS 5.0.0 released!

Glynn Clements glynn.clements at virgin.net
Mon Sep 9 11:03:21 EDT 2002


[CC to grass5]

Malcolm Blue wrote:

> The bad news is that the new math.h in the cygwin distrib has a
> declaration for "round" that conflicts with declaration in
> d.zoom/cmd/set.c and imagery/i.pca/cmd/main.c.  I had to change "round"
> to "_round" in these two files to make these routines compile.

Hmm. GNU libc's math.h also declares "round", but only if __USE_ISOC9X
is defined. I wonder if Cygwin's gcc defaults to C9X rather than C89.

IIRC, the most recent versions of gcc (3.x, maybe some later 2.9x)
have an option to select the dialect (C89/C9X), so it may be possible
to get around this problem by setting CFLAGS prior to running
"configure".

In any case:

1. We should probably pick another name for the function in
d.zoom/cmd/set.c. "round(x)" is normally understood as meaning the
same thing as "floor(x+0.5)".

2. We should consider whether configure should attempt to detect the
existence of a round() function, and define HAVE_ROUND accordingly;
imagery/i.pca/cmd/main.c could then conditionalise its local
definition.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list