From: Florian Forster Date: Mon, 4 May 2009 14:46:02 +0000 (+0200) Subject: Various: Remove strict standards compliance defines. X-Git-Tag: collectd-4.7.0~13^2~8 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=495849c9653298279575edd460b9a4da1df6a678;p=collectd.git Various: Remove strict standards compliance defines. --- diff --git a/src/bind.c b/src/bind.c index c0b18323..587403d0 100644 --- a/src/bind.c +++ b/src/bind.c @@ -21,25 +21,6 @@ * Florian Forster **/ -/* Set to C99 and POSIX code */ -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif -#ifndef _POSIX_SOURCE -# define _POSIX_SOURCE -#endif -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif -#ifndef _REENTRANT -# define _REENTRANT -#endif -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 -#endif -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif #include "collectd.h" #include "common.h" diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c index 8f4a4105..0c480a06 100644 --- a/src/collectd-nagios.c +++ b/src/collectd-nagios.c @@ -19,37 +19,19 @@ * Florian octo Forster **/ -/* Set to C99 and POSIX code */ -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif -#ifndef _POSIX_SOURCE -# define _POSIX_SOURCE -#endif -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif -#ifndef _REENTRANT -# define _REENTRANT +#if HAVE_CONFIG_H +# include "config.h" #endif -/* Disable non-standard extensions */ -#ifdef _BSD_SOURCE -# undef _BSD_SOURCE -#endif -#ifdef _SVID_SOURCE -# undef _SVID_SOURCE -#endif -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif +/* Set to C99 and POSIX code */ +#if COLLECT_STANDARDS +# include "standards.h" +#endif /* COLLECT_STANDARDS */ #if !defined(__GNUC__) || !__GNUC__ # define __attribute__(x) /**/ #endif -#include "config.h" - #include #include #include diff --git a/src/filter_chain.c b/src/filter_chain.c index 01688ee2..c777fac1 100644 --- a/src/filter_chain.c +++ b/src/filter_chain.c @@ -19,44 +19,6 @@ * Florian octo Forster **/ -/* - * First tell the compiler to stick to the C99 and POSIX standards as close as - * possible. - */ -#ifndef __STRICT_ANSI__ /* {{{ */ -# define __STRICT_ANSI__ -#endif - -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifdef _POSIX_C_SOURCE -# undef _POSIX_C_SOURCE -#endif -#define _POSIX_C_SOURCE 200112L - -#if 0 -/* Single UNIX needed for strdup. */ -#ifdef _XOPEN_SOURCE -# undef _XOPEN_SOURCE -#endif -#define _XOPEN_SOURCE 500 -#endif - -#ifndef _REENTRANT -# define _REENTRANT -#endif - -#ifndef _THREAD_SAFE -# define _THREAD_SAFE -#endif - -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* }}} */ - #include "collectd.h" #include "configfile.h" #include "plugin.h" diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 1c67ab72..134a5c4d 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -19,42 +19,19 @@ * Florian octo Forster **/ -/* Set to C99 and POSIX code */ -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif -#ifndef _POSIX_SOURCE -# define _POSIX_SOURCE -#endif -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 -#endif -#ifndef _REENTRANT -# define _REENTRANT +#if HAVE_CONFIG_H +# include "config.h" #endif -/* Disable non-standard extensions */ -#ifdef _BSD_SOURCE -# undef _BSD_SOURCE -#endif -#ifdef _SVID_SOURCE -# undef _SVID_SOURCE -#endif -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif +/* Set to C99 and POSIX code */ +#if COLLECT_STANDARDS +# include "standards.h" +#endif /* COLLECT_STANDARDS */ #if !defined(__GNUC__) || !__GNUC__ # define __attribute__(x) /**/ #endif -#if HAVE_CONFIG_H -# include "config.h" -#endif - #include "lcc_features.h" #include diff --git a/src/meta_data.c b/src/meta_data.c index 1412f7ef..2c085e39 100644 --- a/src/meta_data.c +++ b/src/meta_data.c @@ -19,44 +19,6 @@ * Florian octo Forster **/ -/* - * First tell the compiler to stick to the C99 and POSIX standards as close as - * possible. - */ -#ifndef __STRICT_ANSI__ /* {{{ */ -# define __STRICT_ANSI__ -#endif - -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifdef _POSIX_C_SOURCE -# undef _POSIX_C_SOURCE -#endif -#define _POSIX_C_SOURCE 200112L - -#if 0 -/* Single UNIX needed for strdup. */ -#ifdef _XOPEN_SOURCE -# undef _XOPEN_SOURCE -#endif -#define _XOPEN_SOURCE 500 -#endif - -#ifndef _REENTRANT -# define _REENTRANT -#endif - -#ifndef _THREAD_SAFE -# define _THREAD_SAFE -#endif - -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* }}} */ - #include "collectd.h" #include "plugin.h" #include "meta_data.h" diff --git a/src/target_notification.c b/src/target_notification.c index 9ee1518a..96598afd 100644 --- a/src/target_notification.c +++ b/src/target_notification.c @@ -19,44 +19,6 @@ * Florian Forster **/ -/* - * First tell the compiler to stick to the C99 and POSIX standards as close as - * possible. - */ -#ifndef __STRICT_ANSI__ /* {{{ */ -# define __STRICT_ANSI__ -#endif - -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifdef _POSIX_C_SOURCE -# undef _POSIX_C_SOURCE -#endif -#define _POSIX_C_SOURCE 200112L - -#if 0 -/* Single UNIX needed for strdup. */ -#ifdef _XOPEN_SOURCE -# undef _XOPEN_SOURCE -#endif -#define _XOPEN_SOURCE 500 -#endif - -#ifndef _REENTRANT -# define _REENTRANT -#endif - -#ifndef _THREAD_SAFE -# define _THREAD_SAFE -#endif - -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* }}} */ - #include "collectd.h" #include "common.h" #include "filter_chain.h" diff --git a/src/target_replace.c b/src/target_replace.c index 3f983c86..9a9affb4 100644 --- a/src/target_replace.c +++ b/src/target_replace.c @@ -19,44 +19,6 @@ * Florian Forster **/ -/* - * First tell the compiler to stick to the C99 and POSIX standards as close as - * possible. - */ -#ifndef __STRICT_ANSI__ /* {{{ */ -# define __STRICT_ANSI__ -#endif - -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifdef _POSIX_C_SOURCE -# undef _POSIX_C_SOURCE -#endif -#define _POSIX_C_SOURCE 200112L - -#if 0 -/* Single UNIX needed for strdup. */ -#ifdef _XOPEN_SOURCE -# undef _XOPEN_SOURCE -#endif -#define _XOPEN_SOURCE 500 -#endif - -#ifndef _REENTRANT -# define _REENTRANT -#endif - -#ifndef _THREAD_SAFE -# define _THREAD_SAFE -#endif - -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* }}} */ - #include "collectd.h" #include "common.h" #include "filter_chain.h" diff --git a/src/target_set.c b/src/target_set.c index 19ff7b92..8a014c3c 100644 --- a/src/target_set.c +++ b/src/target_set.c @@ -19,44 +19,6 @@ * Florian Forster **/ -/* - * First tell the compiler to stick to the C99 and POSIX standards as close as - * possible. - */ -#ifndef __STRICT_ANSI__ /* {{{ */ -# define __STRICT_ANSI__ -#endif - -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifdef _POSIX_C_SOURCE -# undef _POSIX_C_SOURCE -#endif -#define _POSIX_C_SOURCE 200112L - -#if 0 -/* Single UNIX needed for strdup. */ -#ifdef _XOPEN_SOURCE -# undef _XOPEN_SOURCE -#endif -#define _XOPEN_SOURCE 500 -#endif - -#ifndef _REENTRANT -# define _REENTRANT -#endif - -#ifndef _THREAD_SAFE -# define _THREAD_SAFE -#endif - -#ifdef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* }}} */ - #include "collectd.h" #include "common.h" #include "filter_chain.h"