diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2017-03-30 22:06:09 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2017-03-30 22:06:09 +0300 |
commit | b15c34355fb42d785b8aa1cc5c6e337a99b50645 (patch) | |
tree | 9c5b35adfbee41b491c2ff78a48a1b673737b6c3 /tests/disclaim_bench.c | |
parent | 61c6fbb9d07022d30ce4652cdcbaaed1820ae390 (diff) | |
download | bdwgc-b15c34355fb42d785b8aa1cc5c6e337a99b50645.tar.gz |
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).
* tests/disclaim_test.c [LINT2]: Do not include gc_priv.h; include
config.h instead.
* tests/disclaim_test.c [LINT2] (GC_API_PRIV): Define.
* tests/disclaim_test.c [LINT2] (GC_random): Declare the function
(instead of including gc_priv.h to get the prototype).
Diffstat (limited to 'tests/disclaim_bench.c')
-rw-r--r-- | tests/disclaim_bench.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/disclaim_bench.c b/tests/disclaim_bench.c index 298bac68..7ae1f3e5 100644 --- a/tests/disclaim_bench.c +++ b/tests/disclaim_bench.c @@ -16,10 +16,16 @@ #include <stdio.h> #include <string.h> -#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 */ + #ifdef LINT2 # undef rand # define rand() (int)GC_random() |