From: Florian Forster Date: Thu, 4 Feb 2010 12:07:06 +0000 (+0100) Subject: src/collectd.h: Add fallback implementations of "isfinite" and "isinf". X-Git-Tag: collectd-4.8.4~27 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e0b3aa9ba8254ab29d86b294553a5413b7efa59a;p=collectd.git src/collectd.h: Add fallback implementations of "isfinite" and "isinf". --- diff --git a/src/collectd.h b/src/collectd.h index 3d8998fd..957654bc 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -135,6 +135,12 @@ typedef bool _Bool; # ifndef isnan # define isnan(f) ((f) != (f)) # endif /* !defined(isnan) */ +# ifndef isfinite +# define isfinite(f) (((f) - (f)) == 0.0) +# endif +# ifndef isinf +# define isinf(f) (!isfinite(f) && !isnan(f)) +# endif #endif /* NAN_ZERO_ZERO */ /* Try really, really hard to determine endianess. Under NexentaStor 1.0.2 this