if test "x$ac_system" = "xSolaris"
then
- CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
fi
# Where to install .pc files.
pkgconfigdir="${libdir}/pkgconfig"
AC_SUBST(pkgconfigdir)
+# Check for standards compliance mode
+AC_ARG_ENABLE(standards,
+ AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
+ [enable_standards="$enableval"],
+ [enable_standards="no"])
+if test "x$enable_standards" = "xyes"
+then
+ AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
+ AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
+ AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
+ AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
+fi
+AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
+
#
# Checks for header files.
#
#endif
])
-AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
+AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
# For the dns plugin
AC_CHECK_HEADERS(arpa/nameser.h)
])
AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
-[#if HAVE_STDINT_H
+[#define _BSD_SOURCE
+#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
#endif
])
AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
-[#if HAVE_STDINT_H
+[#define _BSD_SOURCE
+#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
# FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
AC_COLLECTD([debug], [enable], [feature], [debugging])
AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
-AC_COLLECTD([standards], [enable], [feature], [enable strict standards compliance mode])
AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
dependency_error="no"
utils_tail.c utils_tail.h \
utils_threshold.c utils_threshold.h \
types_list.c types_list.h
-if BUILD_FEATURE_STANDARDS
-collectd_SOURCES += standards.h
-endif
collectd_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
collectd_CFLAGS = $(AM_CFLAGS)
# include "config.h"
#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"
#endif
-/* Set to C99 and POSIX code */
-#if COLLECT_STANDARDS
-# include "standards.h"
-#endif /* COLLECT_STANDARDS */
-
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
* Peter Holik <peter at holik.at>
**/
+#define _BSD_SOURCE /* For setgroups */
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
#include "plugin.h"
#include "configfile.h"
+#include <sys/socket.h>
+
#if OWN_LIBIPTC
# include "libiptc/libiptc.h"
# include "libiptc/libip6tc.h"
# include "config.h"
#endif
-/* Set to C99 and POSIX code */
-#if COLLECT_STANDARDS
-# include "standards.h"
-#endif /* COLLECT_STANDARDS */
-
#if !defined(__GNUC__) || !__GNUC__
# define __attribute__(x) /**/
#endif
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
memset (&serv_addr, 0, sizeof (serv_addr));
serv_addr.sun_family = AF_UNIX;
- sstrncpy (serv_addr.sun_path, memcached_socket, sizeof (serv_addr.sun_path));
+ sstrncpy (serv_addr.sun_path, memcached_socket,
+ sizeof (serv_addr.sun_path));
/* create our socket descriptor */
fd = socket (AF_UNIX, SOCK_STREAM, 0);
/* connect to the memcached daemon */
status = (ssize_t) connect (fd, (struct sockaddr *) &serv_addr,
- SUN_LEN (&serv_addr));
+ sizeof (serv_addr));
if (status != 0) {
shutdown (fd, SHUT_RDWR);
close (fd);
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE /* For struct ip_mreq */
+
#include "collectd.h"
#include "plugin.h"
#include "common.h"
* Florian octo Forster <octo at verplant.org>
**/
+#define _BSD_SOURCE /* For NI_MAXHOST */
+
#include "collectd.h"
#include "common.h"
#include "plugin.h"
+++ /dev/null
-/**
- * collectd - src/collectd.h
- * Copyright (C) 2009 Florian octo Forster
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; only version 2 of the License is applicable.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Authors:
- * Florian octo Forster <octo at verplant.org>
- **/
-
-#ifndef COLLECTD_STANDARDS_H
-#define COLLECTD_STANDARDS_H 1
-
-# 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
-# endif
-
-#if 0
-/* 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
-#endif /* 0 */
-
-#endif /* COLLECTD_STANDARDS_H */
* Florian octo Forster <octo at verplant.org>
*/
+#define _BSD_SOURCE
+
#include "collectd.h"
#include "plugin.h"
#include "common.h"