summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0ebe3ef)
raw | patch | inline | side by side (parent: 0ebe3ef)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 4 May 2009 15:02:59 +0000 (17:02 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 4 May 2009 15:02:59 +0000 (17:02 +0200) |
configure.in | patch | blob | history | |
src/collectd.h | patch | blob | history | |
src/standards.h | [new file with mode: 0644] | patch | blob |
diff --git a/configure.in b/configure.in
index 561d10692201755868fdfa8f76f6cd294cc2691e..4b11554f3c0714224a8ce1ec41b017b13cb337b6 100644 (file)
--- a/configure.in
+++ b/configure.in
# 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"
diff --git a/src/collectd.h b/src/collectd.h
index 18052ba3980130caa048b3b5768de5915c0f9f93..5a039199730253d4633796d3697af3568c2927c2 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
# 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>
diff --git a/src/standards.h b/src/standards.h
--- /dev/null
+++ b/src/standards.h
@@ -0,0 +1,54 @@
+/**
+ * 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 */