Code

collectd-tg: Move _POSIX_C_SOURCE and friends to the Makefile.
authorFlorian Forster <octo@collectd.org>
Fri, 3 Jul 2015 10:31:32 +0000 (12:31 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Mon, 2 May 2016 16:19:03 +0000 (18:19 +0200)
Apparently defining this in the source files confuses Solaris' libc.
Thanks to @dago for looking into this.

Hopefully fixes: #978

src/Makefile.am
src/collectd-tg.c

index 9b845cae6046dbef8774df2142061370a5d8a1af..2f49f4a6b3fad69bfbd2f0079997d069a2c59bc0 100644 (file)
@@ -64,7 +64,9 @@ collectdctl_LDADD += libcollectdclient/libcollectdclient.la
 collectdctl_DEPENDENCIES = libcollectdclient/libcollectdclient.la
 
 collectd_tg_SOURCES = collectd-tg.c
-collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
+collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) \
+                      -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 \
+                      -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
 collectd_tg_LDADD = daemon/libheap.la
 if BUILD_WITH_LIBSOCKET
 collectd_tg_LDADD += -lsocket
index 08bb74877de4ad9b375585fbc2175adf501d3e95..71814a2955357a9a07df0390be43152c9e659060 100644 (file)
 # include "config.h"
 #endif
 
-#ifndef _ISOC99_SOURCE
-# define _ISOC99_SOURCE
-#endif
-
-#ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200809L
-#endif
-
-#ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 700
-#endif
-
 #if !__GNUC__
 # define __attribute__(x) /**/
 #endif