delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/06/11/03:04:20

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: wierd math.h error ---isinff, "long"?
Date: 11 Jun 2003 06:35:55 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 56
Message-ID: <bc6ikb$s6a$1@antares.lu.erisoft.se>
References: <3ee4efa9$0$31822$9b622d9e AT news DOT freenet DOT de> <bc470i$1cb$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <3ee62e57$0$16604$9b622d9e AT news DOT freenet DOT de>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

deckerben (bdeck AT lycos DOT co DOT uk) wrote:

: "Hans-Bernhard Broeker" <broeker AT physik DOT rwth-aachen DOT de> wrote in message
: news:bc470i$1cb$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE...
: > deckerben <bdeck AT lycos DOT co DOT uk> wrote:
: >
: > > /dev/d/usr/djgpp/include/math.h:148: parse error before "long"
: > > /dev/d/usr/djgpp/include/math.h:149: parse error before "long"
: > > /dev/d/usr/djgpp/include/math.h:150: parse error before "long"
: >
: > > When these lines in math.h look like:
: > > extern int isinff(float);
: > > extern int isnanf(float);
: > > extern int finitef(float);

...

: Wow... great function... (smiling). Yeah, *someone* did think it would be
: clever, and that someone wasn't the packager :-)
: <snip/>
: # 13 "/dev/d/usr/djgpp/include/ieeefp.h"
: <snip/>
: #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))
: <snip/>

: These come from lines 76 - 82 of include/math.h. I had suspected these
                                           ^^^^^^ ieeefp.h according
to later message.

: before (I searched the include dir for other occurrances of 'isinff'. I
: believe this causes a conflict in porting some applications that include
: both ieeefp.h and math.h. My DJGPP installation is about five months old.

Does it help to switch the #include order?

: Thanks for the tip. What should be done about this conflict? Ideas?

Ultimately things should be moved to C99 compliance, which means
isinff can be removed (unless it must be kept for backwards
compatibility) because then the macro isinf should be used. (I have
isinf coded already, but not properly integrated and no time at the
moment.)

Perhaps removing the function declaration(s) would be sufficient? But
then you must be careful not to pass non-floats to it, I guess.


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019