diff --git a/include/criterion/criterion.h b/include/criterion/criterion.h index 82a8511..df66d54 100644 --- a/include/criterion/criterion.h +++ b/include/criterion/criterion.h @@ -111,8 +111,8 @@ CR_API int criterion_handle_args(int argc, char *argv[], bool handle_unknown_arg CR_API void criterion_register_test(struct criterion_test_set *tests, struct criterion_test *test); -extern const struct criterion_test *const criterion_current_test; -extern const struct criterion_suite *const criterion_current_suite; +CR_API extern const struct criterion_test *const criterion_current_test; +CR_API extern const struct criterion_suite *const criterion_current_suite; CR_END_C_API diff --git a/include/criterion/options.h b/include/criterion/options.h index 8b5a1a6..793d8c1 100644 --- a/include/criterion/options.h +++ b/include/criterion/options.h @@ -30,6 +30,7 @@ # include # include "logging.h" +# include "internal/common.h" struct criterion_options { @@ -131,7 +132,7 @@ CR_BEGIN_C_API /** * The runtime options for the test runner. */ -extern struct criterion_options criterion_options; +CR_API extern struct criterion_options criterion_options; CR_END_C_API diff --git a/include/criterion/output.h b/include/criterion/output.h index 0f2dbd2..4af8bd0 100644 --- a/include/criterion/output.h +++ b/include/criterion/output.h @@ -40,7 +40,7 @@ typedef void criterion_reporter(FILE *stream, struct criterion_global_stats *); * @returns 1 if no output provider is registered at that name, 0 otherwise, * and -1 on error. */ -int criterion_register_output_provider(const char *name, criterion_reporter *reporter); +CR_API int criterion_register_output_provider(const char *name, criterion_reporter *reporter); /** * Use an output provider to write a report in a specific path. @@ -49,6 +49,6 @@ int criterion_register_output_provider(const char *name, criterion_reporter *rep * @param[in] path The path to the file to write the report to. * @returns -1 on error. */ -int criterion_add_output(const char *provider, const char *path); +CR_API int criterion_add_output(const char *provider, const char *path); #endif /* !CRITERION_OUTPUT_H_ */ diff --git a/include/criterion/types.h b/include/criterion/types.h index e443fc7..876f126 100644 --- a/include/criterion/types.h +++ b/include/criterion/types.h @@ -51,8 +51,6 @@ enum criterion_language { CR_LANG_SIZE_ // leave this at the end }; -extern const char *const cr_language_names[CR_LANG_SIZE_]; - /** * Enumerates the supported kinds of tests */ diff --git a/src/core/runner.c b/src/core/runner.c index 5987327..b8c1d1b 100644 --- a/src/core/runner.c +++ b/src/core/runner.c @@ -113,7 +113,7 @@ static void dtor_test_set(void *ptr, CR_UNUSED void *meta) { sfree(t->suites); } -void criterion_register_test(struct criterion_test_set *set, +CR_API void criterion_register_test(struct criterion_test_set *set, struct criterion_test *test) { struct criterion_suite_set css = { @@ -163,8 +163,8 @@ struct criterion_test_set *criterion_init(void) { return set; } -const struct criterion_test *criterion_current_test; -const struct criterion_suite *criterion_current_suite; +CR_API const struct criterion_test *criterion_current_test; +CR_API const struct criterion_suite *criterion_current_suite; void run_test_child(struct criterion_test *test, struct criterion_suite *suite) { @@ -243,7 +243,7 @@ void disable_unmatching(struct criterion_test_set *set) { free_pattern(); } -struct criterion_test_set *criterion_initialize(void) { +CR_API struct criterion_test_set *criterion_initialize(void) { init_i18n(); #ifndef ENABLE_VALGRIND_ERRORS @@ -266,7 +266,7 @@ struct criterion_test_set *criterion_initialize(void) { return criterion_init(); } -void criterion_finalize(struct criterion_test_set *set) { +CR_API void criterion_finalize(struct criterion_test_set *set) { sfree(set); #ifndef ENABLE_VALGRIND_ERRORS @@ -415,7 +415,7 @@ cleanup: return result; } -int criterion_run_all_tests(struct criterion_test_set *set) { +CR_API int criterion_run_all_tests(struct criterion_test_set *set) { if (criterion_options.pattern) { disable_unmatching(set); } diff --git a/src/entry/options.c b/src/entry/options.c index f54c53e..45f768d 100644 --- a/src/entry/options.c +++ b/src/entry/options.c @@ -23,7 +23,7 @@ */ # include "criterion/options.h" -struct criterion_options criterion_options = { +CR_API struct criterion_options criterion_options = { .logging_threshold = CRITERION_IMPORTANT, .logger = &normal_logging, .measure_time = true, diff --git a/src/entry/params.c b/src/entry/params.c index 7c15cd6..1a02a78 100644 --- a/src/entry/params.c +++ b/src/entry/params.c @@ -130,7 +130,7 @@ int atou(const char *str) { return res < 0 ? 0 : res; } -int criterion_handle_args(int argc, char *argv[], bool handle_unknown_arg) { +CR_API int criterion_handle_args(int argc, char *argv[], bool handle_unknown_arg) { static struct option opts[] = { {"verbose", optional_argument, 0, 'b'}, {"quiet", no_argument, 0, 'q'},