From: Florian Forster Date: Mon, 12 Mar 2007 11:42:07 +0000 (+0100) Subject: src/collectd.h: Define a useable `NAN', based on `configure's findings. X-Git-Tag: collectd-4.0.0-rc4~73 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=396cbeadbb9624da264db2b649636c60920eec35;p=collectd.git src/collectd.h: Define a useable `NAN', based on `configure's findings. --- 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 */