From: Ivan Maidanski Date: Thu, 30 Mar 2017 19:06:09 +0000 (+0300) Subject: Fix mixed include of GC public header and gc_priv.h in disclaim bench/test X-Git-Tag: v7.4.6~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d4c5178f5bb8e6d77a762b61f5fee4dc7cbf08f;p=gc Fix mixed include of GC public header and gc_priv.h in disclaim bench/test Include gc_priv.h should be avoided in tests (if possible) or, at least, this include should not precede include of the public GC headers (because, e.g., gc_priv.h define GC_BUILD which influences declspec of the GC public symbols in case of a shared library). * tests/disclaim_bench.c: Move include gc_priv.h to be after gc_disclaim.h; add comment. * tests/disclaim_bench.c [HAVE_CONFIG_H]: Include "config.h" (before include gc_disclaim.h). --- diff --git a/tests/disclaim_bench.c b/tests/disclaim_bench.c index a2fc3972..df10f986 100644 --- a/tests/disclaim_bench.c +++ b/tests/disclaim_bench.c @@ -16,10 +16,16 @@ #include #include -#include "private/gc_priv.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include "gc_disclaim.h" +/* Include gc_priv.h is done after including GC public headers, so */ +/* that GC_BUILD has no effect on the public prototypes. */ +#include "private/gc_priv.h" /* for CLOCK_TYPE and GC_random */ + #define my_assert(e) \ if (!(e)) { \ fprintf(stderr, "Assertion failure, line %d: " #e "\n", __LINE__); \