From: Florian Forster Date: Sun, 24 Jun 2007 20:40:36 +0000 (+0200) Subject: src/collectd-nagios.c: Copy the NAN-defines from `collectd.h'. X-Git-Tag: collectd-4.0.4~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3cf277cecb508f440bb460f20e218b76b21f45ab;p=collectd.git src/collectd-nagios.c: Copy the NAN-defines from `collectd.h'. This should fix the bug reported by Daniel Leite. --- diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c index 534559ce..fca9f18c 100644 --- a/src/collectd-nagios.c +++ b/src/collectd-nagios.c @@ -11,18 +11,32 @@ #include /* - * This weird macro cascade forces the glibc to define `NAN'. I don't know - * another way to solve this, so more intelligent solutions are welcome. -octo + * This is copied directly from collectd.h. Make changes there! */ -#ifndef __USE_ISOC99 -# define DISABLE__USE_ISOC99 1 -# define __USE_ISOC99 1 -#endif -#include -#ifdef DISABLE__USE_ISOC99 -# undef DISABLE__USE_ISOC99 -# undef __USE_ISOC99 -#endif +#if NAN_STATIC_DEFAULT +# include +/* #endif NAN_STATIC_DEFAULT*/ +#elif NAN_STATIC_ISOC +# ifndef __USE_ISOC99 +# define DISABLE_ISOC99 1 +# define __USE_ISOC99 1 +# endif /* !defined(__USE_ISOC99) */ +# include +# if DISABLE_ISOC99 +# undef DISABLE_ISOC99 +# undef __USE_ISOC99 +# endif /* DISABLE_ISOC99 */ +/* #endif NAN_STATIC_ISOC */ +#elif NAN_ZERO_ZERO +# include +# ifdef NAN +# undef NAN +# endif +# define NAN (0.0 / 0.0) +# ifndef isnan +# define isnan(f) ((f) != (f)) +# endif /* !defined(isnan) */ +#endif /* NAN_ZERO_ZERO */ #define RET_OKAY 0 #define RET_WARNING 1