From 396cbeadbb9624da264db2b649636c60920eec35 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 12 Mar 2007 12:42:07 +0100 Subject: [PATCH] src/collectd.h: Define a useable `NAN', based on `configure's findings. --- src/collectd.h | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/collectd.h b/src/collectd.h index c544bf5c..7bf2f565 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -100,19 +100,27 @@ # define assert(...) /* nop */ #endif -/* - * 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 - */ -#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 +# define NAN (0.0 / 0.0) +# ifndef isnan +# define isnan(f) ((f) != (f)) +# endif /* !defined(isnan) */ +#endif /* NAN_ZERO_ZERO */ #if HAVE_DIRENT_H # include @@ -226,6 +234,4 @@ extern char hostname_g[]; extern int interval_g; -/* int main (int argc, char **argv); */ - #endif /* COLLECTD_H */ -- 2.30.2