From: Florian Forster Date: Thu, 30 Dec 2010 11:28:13 +0000 (+0100) Subject: src/collectd{ctl,-nagios}.c: Remove the standards-flags again. X-Git-Tag: collectd-5.0.0~32 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=6e0ffb3d9edba6a4b819ace076aea0e9b5fcea51 src/collectd{ctl,-nagios}.c: Remove the standards-flags again. Solaris and FreeBSD have problems with it for different reasons. The huge NAN-block from "collectd.h" has been imported again, instead. --- diff --git a/configure.in b/configure.in index 985e8482..63402f2a 100644 --- a/configure.in +++ b/configure.in @@ -756,7 +756,7 @@ if test "x$nan_type" = "xnone"; then [[ #include #include -static float foo = NAN; +static double foo = NAN; ]], [[ if (isnan (foo)) @@ -782,7 +782,7 @@ if test "x$nan_type" = "xnone"; then #include #define __USE_ISOC99 1 #include -static float foo = NAN; +static double foo = NAN; ]], [[ if (isnan (foo)) @@ -816,7 +816,7 @@ if test "x$nan_type" = "xnone"; then #ifndef isnan # define isnan(f) ((f) != (f)) #endif -static float foo = NAN; +static double foo = NAN; ]], [[ if (isnan (foo)) diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c index b3c1855a..af8744de 100644 --- a/src/collectd-nagios.c +++ b/src/collectd-nagios.c @@ -23,18 +23,6 @@ # include "config.h" #endif -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif - -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 -#endif - #if !defined(__GNUC__) || !__GNUC__ # define __attribute__(x) /**/ #endif @@ -46,7 +34,37 @@ #include #include #include -#include + +#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) */ +# ifndef isfinite +# define isfinite(f) (((f) - (f)) == 0.0) +# endif +# ifndef isinf +# define isinf(f) (!isfinite(f) && !isnan(f)) +# endif +#endif /* NAN_ZERO_ZERO */ #include "libcollectdclient/client.h" diff --git a/src/collectdctl.c b/src/collectdctl.c index e1091cc6..3bd8f041 100644 --- a/src/collectdctl.c +++ b/src/collectdctl.c @@ -25,18 +25,6 @@ # include "config.h" #endif -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif - -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 -#endif - #include #include #include @@ -45,10 +33,39 @@ #include #include -#include -#include "libcollectdclient/client.h" +#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) */ +# ifndef isfinite +# define isfinite(f) (((f) - (f)) == 0.0) +# endif +# ifndef isinf +# define isinf(f) (!isfinite(f) && !isnan(f)) +# endif +#endif /* NAN_ZERO_ZERO */ +#include "libcollectdclient/client.h" #define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock"