From 40714ee7451460ff5192f49bcc324e3d9a6f0d7f Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 6 Dec 2015 15:24:16 +0100 Subject: [PATCH] Fix make check on OmniOS We need the defines from config.h before we include , or we get the following error on OmniOS: make test_common test_meta_data test_utils_avltree test_utils_heap test_utils_time test_utils_subst gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -DPREFIX='"/opt/collectd"' -DCONFIGFILE='"/opt/collectd/etc/collectd.conf"' -DLOCALSTATEDIR='"/opt/collectd/var"' -DPKGLOCALSTATEDIR='"/opt/collectd/var/lib/collectd"' -DPIDFILE='"/opt/collectd/var/run/collectd.pid"' -DPLUGINDIR='"/opt/collectd/lib/collectd"' -DPKGDATADIR='"/opt/collectd/share/collectd"' -Wall -Werror -g -O2 -c -o common_test.o common_test.c In file included from collectd.h:31:0, from common.h:31, from common_test.c:28: ../../src/config.h:1631:0: error: "_FILE_OFFSET_BITS" redefined [-Werror] #define _FILE_OFFSET_BITS 64 ^ In file included from /usr/include/inttypes.h:41:0, from ../../src/testing.h:30, from common_test.c:27: /opt/gcc-5.1.0/lib/gcc/i386-pc-solaris2.11/5.1.0/include-fixed/sys/feature_tests.h:231:0: note: this is the location of the previous definition #define _FILE_OFFSET_BITS 32 ^ cc1: all warnings being treated as errors *** Error code 1 make: Fatal error: Command failed for target `common_test.o' --- src/daemon/common_test.c | 2 +- src/daemon/meta_data_test.c | 4 ++-- src/daemon/utils_avltree_test.c | 4 ++-- src/daemon/utils_heap_test.c | 2 +- src/daemon/utils_subst_test.c | 4 ++-- src/daemon/utils_time_test.c | 2 +- src/utils_latency_test.c | 4 ++-- src/utils_mount_test.c | 2 +- src/utils_vl_lookup_test.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/daemon/common_test.c b/src/daemon/common_test.c index 399f8b53..ca8f15a3 100644 --- a/src/daemon/common_test.c +++ b/src/daemon/common_test.c @@ -24,8 +24,8 @@ * Florian octo Forster */ -#include "testing.h" #include "common.h" +#include "testing.h" #if HAVE_LIBKSTAT kstat_ctl_t *kc; diff --git a/src/daemon/meta_data_test.c b/src/daemon/meta_data_test.c index b4c0e276..48760d64 100644 --- a/src/daemon/meta_data_test.c +++ b/src/daemon/meta_data_test.c @@ -24,9 +24,9 @@ * Florian octo Forster */ -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "meta_data.h" DEF_TEST(base) diff --git a/src/daemon/utils_avltree_test.c b/src/daemon/utils_avltree_test.c index 6dbafe18..489d60fa 100644 --- a/src/daemon/utils_avltree_test.c +++ b/src/daemon/utils_avltree_test.c @@ -24,10 +24,10 @@ * Florian octo Forster */ -#include "testing.h" +#include "common.h" /* STATIC_ARRAY_SIZE */ #include "collectd.h" +#include "testing.h" #include "utils_avltree.h" -#include "common.h" /* STATIC_ARRAY_SIZE */ static int compare_total_count = 0; #define RESET_COUNTS() do { compare_total_count = 0; } while (0) diff --git a/src/daemon/utils_heap_test.c b/src/daemon/utils_heap_test.c index 53d0fba8..6ef80475 100644 --- a/src/daemon/utils_heap_test.c +++ b/src/daemon/utils_heap_test.c @@ -24,8 +24,8 @@ * Florian octo Forster */ -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_heap.h" static int compare (void const *v0, void const *v1) diff --git a/src/daemon/utils_subst_test.c b/src/daemon/utils_subst_test.c index c12aa105..ec2e3514 100644 --- a/src/daemon/utils_subst_test.c +++ b/src/daemon/utils_subst_test.c @@ -24,9 +24,9 @@ * Florian octo Forster */ -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "utils_subst.h" #if HAVE_LIBKSTAT diff --git a/src/daemon/utils_time_test.c b/src/daemon/utils_time_test.c index 8eac0b62..73629469 100644 --- a/src/daemon/utils_time_test.c +++ b/src/daemon/utils_time_test.c @@ -26,8 +26,8 @@ #define DBL_PRECISION 1e-3 -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_time.h" DEF_TEST(conversion) diff --git a/src/utils_latency_test.c b/src/utils_latency_test.c index 5769ec95..f275813d 100644 --- a/src/utils_latency_test.c +++ b/src/utils_latency_test.c @@ -26,9 +26,9 @@ #define DBL_PRECISION 1e-9 -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "utils_time.h" #include "utils_latency.h" diff --git a/src/utils_mount_test.c b/src/utils_mount_test.c index b4cb4321..d9d685ae 100644 --- a/src/utils_mount_test.c +++ b/src/utils_mount_test.c @@ -24,8 +24,8 @@ * Florian octo Forster */ -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_mount.h" #if HAVE_LIBKSTAT diff --git a/src/utils_vl_lookup_test.c b/src/utils_vl_lookup_test.c index 41cc0a41..6d23c8c5 100644 --- a/src/utils_vl_lookup_test.c +++ b/src/utils_vl_lookup_test.c @@ -24,8 +24,8 @@ * Florian Forster **/ -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_vl_lookup.h" static _Bool expect_new_obj = 0; -- 2.30.2