From: Florian Forster Date: Fri, 3 Jul 2015 10:31:32 +0000 (+0200) Subject: collectd-tg: Move _POSIX_C_SOURCE and friends to the Makefile. X-Git-Tag: collectd-5.5.2~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f8426d2ac85165658b015fb13216c61fc7d9a6f0;p=collectd.git collectd-tg: Move _POSIX_C_SOURCE and friends to the Makefile. Apparently defining this in the source files confuses Solaris' libc. Thanks to @dago for looking into this. Hopefully fixes: #978 --- diff --git a/src/Makefile.am b/src/Makefile.am index 9b845cae..2f49f4a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/collectd-tg.c b/src/collectd-tg.c index 08bb7487..71814a29 100644 --- a/src/collectd-tg.c +++ b/src/collectd-tg.c @@ -28,18 +28,6 @@ # 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