diff --git a/src/posix-compat.h b/src/posix-compat.h index 3ad0525..0ee7a57 100644 --- a/src/posix-compat.h +++ b/src/posix-compat.h @@ -56,8 +56,8 @@ bool is_current_process(s_proc_handle *proc); # ifdef VANILLA_WIN32 void *get_win_section_start(const char *section); void *get_win_section_end(const char *section); -# define GET_SECTION_START(Name) get_win_section_start(Name) -# define GET_SECTION_END(Name) get_win_section_end(Name) +# define GET_SECTION_START(Name) get_win_section_start(#Name) +# define GET_SECTION_END(Name) get_win_section_end(#Name) # else # define GET_SECTION_START(Name) SECTION_START(Name) # define GET_SECTION_END(Name) SECTION_END(Name) diff --git a/src/report.c b/src/report.c index 8bdab4d..f57758b 100644 --- a/src/report.c +++ b/src/report.c @@ -41,7 +41,7 @@ IMPL_SECTION_LIMITS(f_report_hook, crit_ ## Kind); \ void call_report_hooks_##Kind(void *data) { \ for (f_report_hook *hook = GET_SECTION_START(crit_ ## Kind); \ - hook < GET_SECTION_END(crit_ ## Kind); \ + hook < (f_report_hook*) GET_SECTION_END(crit_ ## Kind); \ ++hook) { \ (*hook)(data); \ } \ diff --git a/src/runner.h b/src/runner.h index 0d47b89..f021ee4 100644 --- a/src/runner.h +++ b/src/runner.h @@ -32,14 +32,14 @@ DECL_SECTION_LIMITS(struct criterion_suite, crit_suites); struct criterion_test_set *criterion_init(void); -# define FOREACH_TEST_SEC(Test) \ - for (struct criterion_test *Test = GET_SECTION_START(criterion_tests); \ - Test < GET_SECTION_END(criterion_tests); \ +# define FOREACH_TEST_SEC(Test) \ + for (struct criterion_test *Test = GET_SECTION_START(criterion_tests); \ + Test < (struct criterion_test*) GET_SECTION_END(criterion_tests); \ ++Test) # define FOREACH_SUITE_SEC(Suite) \ for (struct criterion_suite *Suite = GET_SECTION_START(crit_suites); \ - Suite < GET_SECTION_END(crit_suites); \ + Suite < (struct criterion_suite*) GET_SECTION_END(crit_suites); \ ++Suite) #endif /* !CRITERION_RUNNER_H_ */