[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ntop-dev
Subject:    RE: [Ntop-dev] myrrd my(was Sparc Sol9 patches)
From:       "Burton M. Strauss III" <Burton () ntopsupport ! com>
Date:       2003-08-31 21:02:03
Message-ID: JIEPJGFPFMFIGBNCPKGGCEJNEEAA.Burton () ntopsupport ! com
[Download RAW message or body]

That doesn't seem like too bad a patch.  Except, of course, that you're
imbeding Sun's non-standard packaging into ntop, and Sun's non-standard
define values, that is.  See, pretty much everyone else follows the BSD 4.3
'standard' and has that stuff in math.h - for example, Linux's man isnan:

ISINF(3)                   Linux Programmer's Manual
ISINF(3)



NAME
       isinf, isnan, finite - test for infinity or not-a-number (NaN)

SYNOPSIS
       #include <math.h>

       int isinf(double value);

       int isnan(double value);

       int finite(double value);

DESCRIPTION
       The  isinf() function returns -1 if value represents negative
infinity,
       1 if value represents positive infinity, and 0 otherwise.

       The isnan() function returns a non-zero value if value  is
"not-a-num-
       ber" (NaN), and 0 otherwise.

       The  finite()  function  returns  a  non-zero value if value is
neither
       infinite nor a "not-a-number" (NaN) value, and 0 otherwise.

CONFORMING TO
       BSD 4.3




GNU                               1993-06-02
ISINF(3)

These are the ones like that give us fits - where different OSes package
things into different includes.

If it was in ntop, I'd suggest putting this into one of the #ifdef SOLARIS
blocks in ntop.h.  How does rrd handle this in a cross-platform way?  Linux
does this:

/* Return nonzero value is X is positive or negative infinity.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define isinf(x) \
     (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
# else
#  define isinf(x) \
     (sizeof (x) == sizeof (float)
\
      ? __isinff (x)
\
      : sizeof (x) == sizeof (double)
\
      ? __isinf (x) : __isinfl (x))
# endif

which is just a cutsie way of burying the non-portable stuff into __isinf...

The isnan is safer, because it's just defining a call to a routine.

#ifndef isnan
int isnan(double value);
#endif

Can you do something like that for isinf??

-----Burton


-----Original Message-----
From: ntop-dev-admin@unipi.it [mailto:ntop-dev-admin@unipi.it]On Behalf
Of Chris Turbeville
Sent: Thursday, August 28, 2003 8:56 AM
To: ntop-dev@Unipi.IT
Subject: Re: [Ntop-dev] myrrd my(was Sparc Sol9 patches)


>
> Now you've gone and done it Ollie - a fine, fine mess you've gotten us
into,
> AGAIN, I might add...
>
> There's actually a lot of differences between the 1.0.42 frozen myrrd and
> the current 1.0.45 @ Tobi's page.
>
> Some are trivial name changes, some are in files we don't use, but others
> seem meaningful.  How do you pick & choose?
Well I don't:)  I am just trying to get myrrd as in the CVS to build.
>
> 1. Since you're the 'instant expert', do we need the changes in rrd_diff
and
> rrd_graph between 1.0.42 and 1.0.45?
Ok now thats scary... You had mentioned that myrrd exists because of
stability problems in the rrd releases.  I think my one perspective and
OS shouldn't be used to decide which version meets the stability needs.
That being said which ever rrd we use I can check it for building under
Solaris.  My fix was needed as that version assumed something Sol8&9
didn't have.
>
> 2. I assume your change
>
> #ifndef WIN32
>
> /* unix-only includes */
> #ifndef isnan
> int isnan(double value);
> #endif
>
>  goes in here>>>>>
>
> #else
Yea I was looking for a good -DSOLARIS type thing (but thats in
CPPFLAGS:) and perhaps it could go into config.h. HAVE_ISINF?
I chickened out and just did the #ifndef probably not portable enough.
-Chris
>
>
> -----Burton
>
>
> -----Original Message-----
> From: ntop-dev-admin@unipi.it [mailto:ntop-dev-admin@unipi.it]On Behalf
> Of Chris Turbeville
> Sent: Tuesday, August 26, 2003 9:31 PM
> To: ntop-dev@fuji.unipi.it
> Subject: [Ntop-dev] Sparc Sol9 patches
>
>
> Here's the summary of the work I've done to get NTOP running on Solaris:
>
> <snip/>
>
> This is a fix from newer rrds for a missing function in solaris
> Index: ntop/myrrd/rrd_tool.h
> ===================================================================
> RCS file: /export/home/ntop/ntop/myrrd/rrd_tool.h,v
> retrieving revision 1.2
> diff -r1.2 rrd_tool.h
> 86a87,90
> > #ifndef isinf
> > #include <ieeefp.h>
> > # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
> > #endif
>
>
>
>
> --
> cturbeville@verio.net           Chris Turbeville
> NTT/VERIO
>        Send mail with subject "send PGP Key" for PGP 6.5.2 Public key
>
>
> _______________________________________________
> Ntop-dev mailing list
> Ntop-dev@unipi.it
> http://listgateway.unipi.it/mailman/listinfo/ntop-dev
>


--
cturbeville@verio.net           Chris Turbeville
NTT/VERIO
       Send mail with subject "send PGP Key" for PGP 6.5.2 Public key
_______________________________________________
Ntop-dev mailing list
Ntop-dev@unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic