develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000315.017] Not OK: perl 5.6.0 RC2 on dos-djgpp

Thread Previous | Thread Next
From:
Philip Newton
Date:
March 15, 2000 22:30
Subject:
Re: [ID 20000315.017] Not OK: perl 5.6.0 RC2 on dos-djgpp
Message ID:
200003160630.HAA22597@smtp2.nikoma.de
On 16 Mar 00, at 7:20, Philip Newton wrote:

> extern int (((*(long *)&( float ) & 0x7f800000L)==0x7f800000L) && ((*(long *)&(
> float ) & 0x007fffffL)==0000000000L)) ;

Looks as if /djgpp/include/ieeefp.h is the culprit. Here's the output of `grep 
isnanf /djgpp/include/*.h`:

/djgpp/include/ieeefp.h:int _EXFUN(isnanf, (float));
/djgpp/include/ieeefp.h:#define isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f8
00000L) && \
/djgpp/include/math.h:extern int isnanf(float);

Looks familiar.

OK, here's the real bits of ieeefp.h:

int _EXFUN(isnanf, (float));
int _EXFUN(isinff, (float));
int _EXFUN(finitef, (float));

(These just expand to:  int isnanf (float);  and similar)

#define isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
                   ((*(long *)&(x) & 0x007fffffL)!=0000000000L))

#define isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
                   ((*(long *)&(x) & 0x007fffffL)==0000000000L))

#define finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L))

(And these are the real culprits. They're macros.)

So, in DJGPP, it looks as if you can't include both ieeefp.h and math.h, or at 
least not ieeefp.h *before* math.h.

Looks pretty horrid. I'm not sure what the best fix is, though -- whether to 
rearrange the order of includes in perl.h, or maybe to undef one of I_MATH or 
I_IEEEFP on djgpp, or something else.

Cheers,
Philip
-- 
Philip Newton <Philip.Newton@gmx.net>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About