On Mon, 1 Mar 2004, Brad Cavanagh wrote:
> On Mon, 1 Mar 2004 11:45:11 +0000
> Norman Gray <[log in to unmask]> wrote:
>
> > I think that Brad's built sst on OS X, and by implication everything
> > before that, so it should be that he can go ahead and build AST on the
> > branch, but I don't think he's actually said that. I don't see there
> > being a problem, though. (Brad can speak for himself, of course, but
> > is doubtless asleep by now).
>
> I've built AST now, yes. It required tweaks to mapping.c and specmap.c though.
> Both of them define isnan because, according to the comments, math.h doesn't
> include a prototype for it. On OS X math.h includes
> architecture/[i386|ppc]/math.h which does include a macro for it. This was
> causing the compilation to fail with a "parse error before sizeof" error.
This is because isnan is a macro that includes sizeof in its definition.
I'm not sure how declaring a prototype to the macro ever worked. It's a
macro on linux too, but an actual function on solaris.
>
> I put "#ifndef isnan / #endif" around the prototype in both files and
> compilation went through fine after that. I'm a touch hesitant to check this in
> in case there are other platforms that don't define isnan as a macro.
>
I don't think there's a problem with the patch because if isnan() is
defined as a macro you don't need the prototype. If isnan() is a function
and not a macro you'll end up defining a protoype which should hopefully
be identical to the system prototype.
A test for isnan is something that configure should be dealing with so
that a
#ifndef HAS_ISNAN
# define isnan(x) ((x)!=(x))
#endif
[this is what Perl uses as last resort if isnan() is missing]
can be used instead (with a corresponding -DHAS_ISNAN on the gcc command
line).
> I have to note that this is a little odd because I was able to compile AST just
> fine in the old pre-CVS system without having to tweak anything. Is there a
> configuration issue here, possibly?
>
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|