From b25a939e2d8b045c083caf3264c4e5aac1cf88fb Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 15 Apr 2025 15:51:40 +0200 Subject: Better logging function Now it is possible to provide some data together with the logging function. This is useful for example in C++, where I can now provide an arbitrary callable object as data, and a simple wrapper function that call the callable object as logging function. --- test/test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test.h b/test/test.h index 0b12fb7..97f229b 100644 --- a/test/test.h +++ b/test/test.h @@ -31,13 +31,13 @@ int64_t writecube(const char *, cube_t, size_t n, char [n]); /* Test function to be implemented by all tests */ void run(void); -void log_stderr(const char *str) +void log_stderr(const char *str, void *unused) { fprintf(stderr, "%s", str); } int main(void) { - nissy_setlogger(log_stderr); + nissy_setlogger(log_stderr, NULL); run(); return 0; } -- cgit v1.3