From 3cf277cecb508f440bb460f20e218b76b21f45ab Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 24 Jun 2007 22:40:36 +0200 Subject: [PATCH] src/collectd-nagios.c: Copy the NAN-defines from `collectd.h'. This should fix the bug reported by Daniel Leite. --- src/collectd-nagios.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) 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 -- 2.11.0